Ticket #17064: 17064.diff
| File 17064.diff, 3.6 KB (added by aaroncampbell, 2 years ago) |
|---|
-
wp-includes/class-pop3.php
1 1 <?php 2 2 3 /** 3 4 * mail_fetch/setup.php 4 5 * 5 * @package SquirrelMail 6 * 7 * @copyright (c) 1999-2006 The SquirrelMail Project Team 8 * 9 * @copyright (c) 1999 CDI (cdi@thewebmasters.net) All Rights Reserved 10 * Modified by Philippe Mingo 2001 mingo@rotedic.com 6 * Copyright (c) 1999-2011 CDI (cdi@thewebmasters.net) All Rights Reserved 7 * Modified by Philippe Mingo 2001-2009 mingo@rotedic.com 11 8 * An RFC 1939 compliant wrapper class for the POP3 protocol. 12 9 * 13 10 * Licensed under the GNU GPL. For full terms see the file COPYING. 14 * @license http://opensource.org/licenses/gpl-license.php GNU General Public License15 11 * 16 * pop3 class12 * POP3 class 17 13 * 18 * $Id$ 14 * @copyright 1999-2011 The SquirrelMail Project Team 15 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 16 * @version $Id$ 17 * @package plugins 18 * @subpackage mail_fetch 19 19 */ 20 20 21 21 class POP3 { … … 76 76 77 77 // If MAILSERVER is set, override $server with it's value 78 78 79 if (!isset($port) || !$port) {$port = 110;}79 if (!isset($port) || !$port) {$port = 110;} 80 80 if(!empty($this->MAILSERVER)) 81 81 $server = $this->MAILSERVER; 82 82 … … 253 253 $MsgArray = array(); 254 254 255 255 $line = fgets($fp,$buffer); 256 while ( ! ereg("^\.\r\n",$line))256 while ( !preg_match('/^\.\r\n/',$line)) 257 257 { 258 258 $MsgArray[$count] = $line; 259 259 $count++; … … 320 320 if($msgC > $Total) { break; } 321 321 $line = fgets($fp,$this->BUFFER); 322 322 $line = $this->strip_clf($line); 323 if( ereg("^\.",$line))323 if(strpos($line, '.') === 0) 324 324 { 325 325 $this->ERROR = "POP3 pop_list: " . _("Premature end of list"); 326 326 return false; … … 366 366 $MsgArray = array(); 367 367 368 368 $line = fgets($fp,$buffer); 369 while ( ! ereg("^\.\r\n",$line))369 while ( !preg_match('/^\.\r\n/',$line)) 370 370 { 371 if ( $line [0]== '.' ) { $line = substr($line,1); }371 if ( $line{0} == '.' ) { $line = substr($line,1); } 372 372 $MsgArray[$count] = $line; 373 373 $count++; 374 374 $line = fgets($fp,$buffer); … … 554 554 $line = ""; 555 555 $count = 1; 556 556 $line = fgets($fp,$buffer); 557 while ( !ereg("^\.\r\n",$line)) { 558 if(ereg("^\.\r\n",$line)) { 559 break; 560 } 557 while ( !preg_match('/^\.\r\n/',$line)) { 561 558 list ($msg,$msgUidl) = preg_split('/\s+/',$line); 562 559 $msgUidl = $this->strip_clf($msgUidl); 563 560 if($count == $msg) { … … 607 604 if( empty($cmd) ) 608 605 return false; 609 606 else 610 return( ereg ("^\+OK", $cmd ));607 return( stripos($cmd, '+OK') !== false ); 611 608 } 612 609 613 610 function strip_clf ($text = "") { … … 616 613 if(empty($text)) 617 614 return $text; 618 615 else { 619 $stripped = str_replace("\r",'',$text); 620 $stripped = str_replace("\n",'',$stripped); 616 $stripped = str_replace(array("\r","\n"),'',$text); 621 617 return $stripped; 622 618 } 623 619 } … … 649 645 } 650 646 651 647 } // End class 652 ?> 648 649 // For php4 compatibility 650 if (!function_exists("stripos")) { 651 function stripos($haystack, $needle){ 652 return strpos($haystack, stristr( $haystack, $needle )); 653 } 654 }
