X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7688c6ba71852cd89123b62b2d57683535e4702a..f5fcdc7994bb67cce809bc4777944ae8b7fad4a4:/wp-includes/class-pop3.php diff --git a/wp-includes/class-pop3.php b/wp-includes/class-pop3.php index 38c6694b..d0455d7e 100644 --- a/wp-includes/class-pop3.php +++ b/wp-includes/class-pop3.php @@ -1,20 +1,20 @@ MAILSERVER)) $server = $this->MAILSERVER; @@ -251,7 +251,7 @@ class POP3 { $MsgArray = array(); $line = fgets($fp,$buffer); - while ( !ereg("^\.\r\n",$line)) + while ( !preg_match('/^\.\r\n/',$line)) { $MsgArray[$count] = $line; $count++; @@ -318,7 +318,7 @@ class POP3 { if($msgC > $Total) { break; } $line = fgets($fp,$this->BUFFER); $line = $this->strip_clf($line); - if(ereg("^\.",$line)) + if(strpos($line, '.') === 0) { $this->ERROR = "POP3 pop_list: " . _("Premature end of list"); return false; @@ -364,7 +364,7 @@ class POP3 { $MsgArray = array(); $line = fgets($fp,$buffer); - while ( !ereg("^\.\r\n",$line)) + while ( !preg_match('/^\.\r\n/',$line)) { if ( $line{0} == '.' ) { $line = substr($line,1); } $MsgArray[$count] = $line; @@ -552,10 +552,7 @@ class POP3 { $line = ""; $count = 1; $line = fgets($fp,$buffer); - while ( !ereg("^\.\r\n",$line)) { - if(ereg("^\.\r\n",$line)) { - break; - } + while ( !preg_match('/^\.\r\n/',$line)) { list ($msg,$msgUidl) = preg_split('/\s+/',$line); $msgUidl = $this->strip_clf($msgUidl); if($count == $msg) { @@ -605,7 +602,7 @@ class POP3 { if( empty($cmd) ) return false; else - return( ereg ("^\+OK", $cmd ) ); + return( stripos($cmd, '+OK') !== false ); } function strip_clf ($text = "") { @@ -614,8 +611,7 @@ class POP3 { if(empty($text)) return $text; else { - $stripped = str_replace("\r",'',$text); - $stripped = str_replace("\n",'',$stripped); + $stripped = str_replace(array("\r","\n"),'',$text); return $stripped; } } @@ -647,4 +643,10 @@ class POP3 { } } // End class -?> + +// For php4 compatibility +if (!function_exists("stripos")) { + function stripos($haystack, $needle){ + return strpos($haystack, stristr( $haystack, $needle )); + } +}