X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fmail_fetch%2Fclass.POP3.php;h=f19b3cd96af174f0398dd89e74603a81c4df9b02;hp=7d266a478194bf0ab81a1e69c32712dac4a362d9;hb=598294a727a2789b7c562ee7083da703c8bb0628;hpb=b2b998352dc6c048cb367607cdf3db455dea365a diff --git a/plugins/mail_fetch/class.POP3.php b/plugins/mail_fetch/class.POP3.php index 7d266a47..f19b3cd9 100644 --- a/plugins/mail_fetch/class.POP3.php +++ b/plugins/mail_fetch/class.POP3.php @@ -1,9 +1,9 @@ -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 +79,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 +90,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]"; @@ -106,18 +114,6 @@ class POP3 { return true; } - function noop () { - - if(!isset($this->FP)) { - $this->ERROR = _("POP3 noop:") . ' ' . _("No connection to server"); - return false; - } else { - $cmd = "NOOP"; - $reply = $this->send_cmd( $cmd ); - return( $this->is_ok( $reply ) ); - } - } - function user ($user = "") { // Sends the USER command, returns true or false @@ -310,7 +306,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"; @@ -333,7 +329,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) { @@ -403,7 +399,7 @@ class POP3 { return $last; } - $Vars = explode(" ",$reply); + $Vars = preg_split('/\s+/',$reply); $count = $Vars[1]; $size = $Vars[2]; settype($count,"integer"); @@ -534,7 +530,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(); @@ -565,7 +561,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; @@ -657,4 +653,4 @@ class POP3 { } // End class -?> +?> \ No newline at end of file