Changeset 4945
- Timestamp:
- 02/25/2007 06:19:21 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-pop3.php
r4938 r4945 4 4 * mail_fetch/setup.php 5 5 * 6 * Copyright (c) 1999-200 2The SquirrelMail Project Team6 * Copyright (c) 1999-2006 The SquirrelMail Project Team 7 7 * 8 8 * Copyright (c) 1999 CDI (cdi@thewebmasters.net) All Rights Reserved … … 41 41 // pop server - used for apop() 42 42 43 var $RFC1939 = TRUE; // Set by noop(). See rfc1939.txt44 //45 46 43 var $ALLOWAPOP = FALSE; // Allow or disallow apop() 47 44 // This must be set to true … … 60 57 settype($timeout,"integer"); 61 58 $this->TIMEOUT = $timeout; 59 if (!ini_get('safe_mode')) 62 60 set_time_limit($timeout); 63 61 } … … 66 64 67 65 function update_timer () { 66 if (!ini_get('safe_mode')) 68 67 set_time_limit($this->TIMEOUT); 69 68 return true; … … 76 75 // If MAILSERVER is set, override $server with it's value 77 76 77 if (!isset($port) || !$port) {$port = 110;} 78 78 if(!empty($this->MAILSERVER)) 79 79 $server = $this->MAILSERVER; … … 85 85 } 86 86 87 $fp = fsockopen("$server", $port, $errno, $errstr);87 $fp = @fsockopen("$server", $port, $errno, $errstr); 88 88 89 89 if(!$fp) { … … 106 106 $this->FP = $fp; 107 107 $this->BANNER = $this->parse_banner($reply); 108 $this->RFC1939 = $this->noop(); 109 if($this->RFC1939) { 110 $this->ERROR = _("POP3: premature NOOP OK, NOT an RFC 1939 Compliant server"); 111 $this->quit(); 112 return false; 113 } else 114 return true; 115 } 116 117 function noop () { 118 119 if(!isset($this->FP)) { 120 $this->ERROR = _("POP3 noop:") . ' ' . _("No connection to server"); 121 return false; 122 } else { 123 $cmd = "NOOP"; 124 $reply = $this->send_cmd( $cmd ); 125 return( $this->is_ok( $reply ) ); 126 } 108 return true; 127 109 } 128 110 … … 159 141 $reply = $this->send_cmd("PASS $pass"); 160 142 if(!$this->is_ok($reply)) { 161 $this->ERROR = _("POP3 pass:") . ' ' . _(" authentication failed ") . "[$reply]";143 $this->ERROR = _("POP3 pass:") . ' ' . _("Authentication failed ") . "[$reply]"; 162 144 $this->quit(); 163 145 return false; … … 166 148 $count = $this->last("count"); 167 149 $this->COUNT = $count; 168 $this->RFC1939 = $this->noop(); 169 if(!$this->RFC1939) { 170 $this->ERROR = _("POP3 pass:") . ' ' . _("NOOP failed. Server not RFC 1939 compliant"); 171 $this->quit(); 172 return false; 173 } else 174 return $count; 150 return $count; 175 151 } 176 152 } … … 215 191 $count = $this->last("count"); 216 192 $this->COUNT = $count; 217 $this->RFC1939 = $this->noop(); 218 if(!$this->RFC1939) { 219 $this->ERROR = _("POP3 apop:") . ' ' . _("NOOP failed. Server not RFC 1939 compliant"); 220 $this->quit(); 221 return false; 222 } else 223 return $count; 193 return $count; 224 194 } 225 195 } … … 331 301 return false; 332 302 } 333 list($junk,$num,$size) = explode(" ",$reply);303 list($junk,$num,$size) = preg_split('/\s+/',$reply); 334 304 return $size; 335 305 } … … 354 324 return false; 355 325 } 356 list($thisMsg,$msgSize) = explode(" ",$line);326 list($thisMsg,$msgSize) = preg_split('/\s+/',$line); 357 327 settype($thisMsg,"integer"); 358 328 if($thisMsg != $msgC) … … 429 399 } 430 400 431 $Vars = explode(" ",$reply);401 $Vars = preg_split('/\s+/',$reply); 432 402 $count = $Vars[1]; 433 403 $size = $Vars[2]; … … 560 530 return false; 561 531 } 562 list ($ok,$num,$myUidl) = explode(" ",$reply);532 list ($ok,$num,$myUidl) = preg_split('/\s+/',$reply); 563 533 return $myUidl; 564 534 } else { … … 591 561 break; 592 562 } 593 list ($msg,$msgUidl) = explode(" ",$line);563 list ($msg,$msgUidl) = preg_split('/\s+/',$line); 594 564 $msgUidl = $this->strip_clf($msgUidl); 595 565 if($count == $msg) { … … 662 632 { 663 633 $digit = substr($server_text, $count, 1); 664 if ( false !== $digit) {634 if (!empty($digit)) { 665 635 if( (!$outside) && ($digit != '<') && ($digit != '>') ) 666 636 {
Note: See TracChangeset
for help on using the changeset viewer.