X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fmail_fetch%2Fclass.POP3.php;h=28daed7c090574dd98ef07a9d34734ae96cc58da;hp=9b1883ff2ccb974d930ff285c9a816a31841732b;hb=939d8f7f54d02ff64becd0a86974c27572281b0a;hpb=6f736941c193b48faf892fbdd0e0343034b2d5b0 diff --git a/plugins/mail_fetch/class.POP3.php b/plugins/mail_fetch/class.POP3.php index 9b1883ff..28daed7c 100644 --- a/plugins/mail_fetch/class.POP3.php +++ b/plugins/mail_fetch/class.POP3.php @@ -1,21 +1,26 @@ -TIMEOUT = $timeout; - set_time_limit($timeout); + if (!ini_get('safe_mode')) + set_time_limit($timeout); } return true; } function update_timer () { - set_time_limit($this->TIMEOUT); + if (!ini_get('safe_mode')) + set_time_limit($this->TIMEOUT); return true; } @@ -71,8 +78,8 @@ class POP3 { // port defaults to 110. Returns true on success, false on fail // If MAILSERVER is set, override $server with it's value - - if (!isset($port) || !$port) {$port = 110;} + + if (!isset($port) || !$port) {$port = 110;} if(!empty($this->MAILSERVER)) $server = $this->MAILSERVER; @@ -82,7 +89,7 @@ class POP3 { return false; } - $fp = fsockopen("$server", $port, $errno, $errstr); + $fp = @fsockopen("$server", $port, $errno, $errstr); if(!$fp) { $this->ERROR = _("POP3 connect:") . ' ' . _("Error ") . "[$errno] [$errstr]"; @@ -138,7 +145,7 @@ class POP3 { } else { $reply = $this->send_cmd("PASS $pass"); if(!$this->is_ok($reply)) { - $this->ERROR = _("POP3 pass:") . ' ' . _("authentication failed ") . "[$reply]"; + $this->ERROR = _("POP3 pass:") . ' ' . _("Authentication failed") . " [$reply]"; $this->quit(); return false; } else { @@ -298,7 +305,7 @@ class POP3 { $this->ERROR = _("POP3 pop_list:") . ' ' . _("Error ") . "[$reply]"; return false; } - list($junk,$num,$size) = explode(" ",$reply); + list($junk,$num,$size) = preg_split('/\s+/',$reply); return $size; } $cmd = "LIST"; @@ -321,7 +328,7 @@ class POP3 { $this->ERROR = _("POP3 pop_list:") . ' ' . _("Premature end of list"); return false; } - list($thisMsg,$msgSize) = explode(" ",$line); + list($thisMsg,$msgSize) = preg_split('/\s+/',$line); settype($thisMsg,"integer"); if($thisMsg != $msgC) { @@ -391,7 +398,7 @@ class POP3 { return $last; } - $Vars = explode(" ",$reply); + $Vars = preg_split('/\s+/',$reply); $count = $Vars[1]; $size = $Vars[2]; settype($count,"integer"); @@ -522,7 +529,7 @@ class POP3 { $this->ERROR = _("POP3 uidl:") . ' ' . _("Error ") . "[$reply]"; return false; } - list ($ok,$num,$myUidl) = explode(" ",$reply); + list ($ok,$num,$myUidl) = preg_split('/\s+/',$reply); return $myUidl; } else { $this->update_timer(); @@ -553,7 +560,7 @@ class POP3 { if(ereg("^\.\r\n",$line)) { break; } - list ($msg,$msgUidl) = explode(" ",$line); + list ($msg,$msgUidl) = preg_split('/\s+/',$line); $msgUidl = $this->strip_clf($msgUidl); if($count == $msg) { $UIDLArray[$msg] = $msgUidl; @@ -645,4 +652,4 @@ class POP3 { } // End class -?> +?> \ No newline at end of file