Changeset 6044 for trunk/wp-includes/class-pop3.php
- Timestamp:
- 09/05/2007 10:55:38 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-pop3.php
r6026 r6044 58 58 $this->TIMEOUT = $timeout; 59 59 if (!ini_get('safe_mode')) 60 set_time_limit($timeout);60 set_time_limit($timeout); 61 61 } 62 62 return true; … … 65 65 function update_timer () { 66 66 if (!ini_get('safe_mode')) 67 set_time_limit($this->TIMEOUT);67 set_time_limit($this->TIMEOUT); 68 68 return true; 69 69 } … … 75 75 // If MAILSERVER is set, override $server with it's value 76 76 77 77 if (!isset($port) || !$port) {$port = 110;} 78 78 if(!empty($this->MAILSERVER)) 79 79 $server = $this->MAILSERVER; 80 80 81 81 if(empty($server)){ 82 $this->ERROR = _("POP3 connect:") . ' '. _("No server specified");82 $this->ERROR = "POP3 connect: " . _("No server specified"); 83 83 unset($this->FP); 84 84 return false; … … 88 88 89 89 if(!$fp) { 90 $this->ERROR = _("POP3 connect:") . ' '. _("Error ") . "[$errno] [$errstr]";90 $this->ERROR = "POP3 connect: " . _("Error ") . "[$errno] [$errstr]"; 91 91 unset($this->FP); 92 92 return false; … … 100 100 error_log("POP3 SEND [connect: $server] GOT [$reply]",0); 101 101 if(!$this->is_ok($reply)) { 102 $this->ERROR = _("POP3 connect:") . ' '. _("Error ") . "[$reply]";102 $this->ERROR = "POP3 connect: " . _("Error ") . "[$reply]"; 103 103 unset($this->FP); 104 104 return false; … … 113 113 114 114 if( empty($user) ) { 115 $this->ERROR = _("POP3 user:") . ' '. _("no login ID submitted");115 $this->ERROR = "POP3 user: " . _("no login ID submitted"); 116 116 return false; 117 117 } elseif(!isset($this->FP)) { 118 $this->ERROR = _("POP3 user:") . ' '. _("connection not established");118 $this->ERROR = "POP3 user: " . _("connection not established"); 119 119 return false; 120 120 } else { 121 121 $reply = $this->send_cmd("USER $user"); 122 122 if(!$this->is_ok($reply)) { 123 $this->ERROR = _("POP3 user:") . ' '. _("Error ") . "[$reply]";123 $this->ERROR = "POP3 user: " . _("Error ") . "[$reply]"; 124 124 return false; 125 125 } else … … 133 133 134 134 if(empty($pass)) { 135 $this->ERROR = _("POP3 pass:") . ' '. _("No password submitted");135 $this->ERROR = "POP3 pass: " . _("No password submitted"); 136 136 return false; 137 137 } elseif(!isset($this->FP)) { 138 $this->ERROR = _("POP3 pass:") . ' '. _("connection not established");138 $this->ERROR = "POP3 pass: " . _("connection not established"); 139 139 return false; 140 140 } else { 141 141 $reply = $this->send_cmd("PASS $pass"); 142 142 if(!$this->is_ok($reply)) { 143 $this->ERROR = _("POP3 pass:") . ' ' . _("Authentication failed ") . "[$reply]";143 $this->ERROR = "POP3 pass: " . _("Authentication failed") . " [$reply]"; 144 144 $this->quit(); 145 145 return false; … … 160 160 161 161 if(!isset($this->FP)) { 162 $this->ERROR = _("POP3 apop:") . ' '. _("No connection to server");162 $this->ERROR = "POP3 apop: " . _("No connection to server"); 163 163 return false; 164 164 } elseif(!$this->ALLOWAPOP) { … … 166 166 return $retVal; 167 167 } elseif(empty($login)) { 168 $this->ERROR = _("POP3 apop:") . ' '. _("No login ID submitted");168 $this->ERROR = "POP3 apop: " . _("No login ID submitted"); 169 169 return false; 170 170 } elseif(empty($pass)) { 171 $this->ERROR = _("POP3 apop:") . ' '. _("No password submitted");171 $this->ERROR = "POP3 apop: " . _("No password submitted"); 172 172 return false; 173 173 } else { 174 174 $banner = $this->BANNER; 175 175 if( (!$banner) or (empty($banner)) ) { 176 $this->ERROR = _("POP3 apop:") . ' '. _("No server banner") . ' - ' . _("abort");176 $this->ERROR = "POP3 apop: " . _("No server banner") . ' - ' . _("abort"); 177 177 $retVal = $this->login($login,$pass); 178 178 return $retVal; … … 184 184 $reply = $this->send_cmd($cmd); 185 185 if(!$this->is_ok($reply)) { 186 $this->ERROR = _("POP3 apop:") . ' '. _("apop authentication failed") . ' - ' . _("abort");186 $this->ERROR = "POP3 apop: " . _("apop authentication failed") . ' - ' . _("abort"); 187 187 $retVal = $this->login($login,$pass); 188 188 return $retVal; … … 203 203 204 204 if( !isset($this->FP) ) { 205 $this->ERROR = _("POP3 login:") . ' '. _("No connection to server");205 $this->ERROR = "POP3 login: " . _("No connection to server"); 206 206 return false; 207 207 } else { … … 228 228 229 229 if(!isset($this->FP)) { 230 $this->ERROR = _("POP3 top:") . ' '. _("No connection to server");230 $this->ERROR = "POP3 top: " . _("No connection to server"); 231 231 return false; 232 232 } … … 244 244 if(!$this->is_ok($reply)) 245 245 { 246 $this->ERROR = _("POP3 top:") . ' '. _("Error ") . "[$reply]";246 $this->ERROR = "POP3 top: " . _("Error ") . "[$reply]"; 247 247 return false; 248 248 } … … 270 270 if(!isset($this->FP)) 271 271 { 272 $this->ERROR = _("POP3 pop_list:") . ' '. _("No connection to server");272 $this->ERROR = "POP3 pop_list: " . _("No connection to server"); 273 273 return false; 274 274 } … … 298 298 if(!$this->is_ok($reply)) 299 299 { 300 $this->ERROR = _("POP3 pop_list:") . ' '. _("Error ") . "[$reply]";300 $this->ERROR = "POP3 pop_list: " . _("Error ") . "[$reply]"; 301 301 return false; 302 302 } … … 309 309 { 310 310 $reply = $this->strip_clf($reply); 311 $this->ERROR = _("POP3 pop_list:") . ' '. _("Error ") . "[$reply]";311 $this->ERROR = "POP3 pop_list: " . _("Error ") . "[$reply]"; 312 312 return false; 313 313 } … … 321 321 if(ereg("^\.",$line)) 322 322 { 323 $this->ERROR = _("POP3 pop_list:") . ' '. _("Premature end of list");323 $this->ERROR = "POP3 pop_list: " . _("Premature end of list"); 324 324 return false; 325 325 } … … 344 344 if(!isset($this->FP)) 345 345 { 346 $this->ERROR = _("POP3 get:") . ' '. _("No connection to server");346 $this->ERROR = "POP3 get: " . _("No connection to server"); 347 347 return false; 348 348 } … … 357 357 if(!$this->is_ok($reply)) 358 358 { 359 $this->ERROR = _("POP3 get:") . ' '. _("Error ") . "[$reply]";359 $this->ERROR = "POP3 get: " . _("Error ") . "[$reply]"; 360 360 return false; 361 361 } … … 364 364 $MsgArray = array(); 365 365 366 $line = "";366 $line = fgets($fp,$buffer); 367 367 while ( !ereg("^\.\r\n",$line)) 368 368 { 369 $line = fgets($fp,$buffer); 370 if (preg_match("/^\s+/", $line) && $count > 0) { 371 $MsgArray[$count-1] .= $line; 372 continue; 373 } 374 if(empty($line)) { break; } 375 369 if ( $line{0} == '.' ) { $line = substr($line,1); } 376 370 $MsgArray[$count] = $line; 377 371 $count++; 372 $line = fgets($fp,$buffer); 373 if(empty($line)) { break; } 378 374 } 379 375 return $MsgArray; … … 388 384 if(!isset($this->FP)) 389 385 { 390 $this->ERROR = _("POP3 last:") . ' '. _("No connection to server");386 $this->ERROR = "POP3 last: " . _("No connection to server"); 391 387 return $last; 392 388 } … … 395 391 if(!$this->is_ok($reply)) 396 392 { 397 $this->ERROR = _("POP3 last:") . ' '. _("Error ") . "[$reply]";393 $this->ERROR = "POP3 last: " . _("Error ") . "[$reply]"; 398 394 return $last; 399 395 } … … 418 414 if(!isset($this->FP)) 419 415 { 420 $this->ERROR = _("POP3 reset:") . ' '. _("No connection to server");416 $this->ERROR = "POP3 reset: " . _("No connection to server"); 421 417 return false; 422 418 } … … 428 424 // wild is going on. 429 425 430 $this->ERROR = _("POP3 reset:") . ' '. _("Error ") . "[$reply]";426 $this->ERROR = "POP3 reset: " . _("Error ") . "[$reply]"; 431 427 @error_log("POP3 reset: ERROR [$reply]",0); 432 428 } … … 452 448 if(!isset($this->FP)) 453 449 { 454 $this->ERROR = _("POP3 send_cmd:") . ' '. _("No connection to server");450 $this->ERROR = "POP3 send_cmd: " . _("No connection to server"); 455 451 return false; 456 452 } … … 458 454 if(empty($cmd)) 459 455 { 460 $this->ERROR = _("POP3 send_cmd:") . ' '. _("Empty command string");456 $this->ERROR = "POP3 send_cmd: " . _("Empty command string"); 461 457 return ""; 462 458 } … … 478 474 if(!isset($this->FP)) 479 475 { 480 $this->ERROR = _("POP3 quit:") . ' '. _("connection does not exist");476 $this->ERROR = "POP3 quit: " . _("connection does not exist"); 481 477 return false; 482 478 } … … 515 511 516 512 if(!isset($this->FP)) { 517 $this->ERROR = _("POP3 uidl:") . ' '. _("No connection to server");513 $this->ERROR = "POP3 uidl: " . _("No connection to server"); 518 514 return false; 519 515 } … … 527 523 if(!$this->is_ok($reply)) 528 524 { 529 $this->ERROR = _("POP3 uidl:") . ' '. _("Error ") . "[$reply]";525 $this->ERROR = "POP3 uidl: " . _("Error ") . "[$reply]"; 530 526 return false; 531 527 } … … 550 546 if(!$this->is_ok($reply)) 551 547 { 552 $this->ERROR = _("POP3 uidl:") . ' '. _("Error ") . "[$reply]";548 $this->ERROR = "POP3 uidl: " . _("Error ") . "[$reply]"; 553 549 return false; 554 550 } … … 583 579 if(!isset($this->FP)) 584 580 { 585 $this->ERROR = _("POP3 delete:") . ' '. _("No connection to server");581 $this->ERROR = "POP3 delete: " . _("No connection to server"); 586 582 return false; 587 583 } 588 584 if(empty($msgNum)) 589 585 { 590 $this->ERROR = _("POP3 delete:") . ' '. _("No msg number submitted");586 $this->ERROR = "POP3 delete: " . _("No msg number submitted"); 591 587 return false; 592 588 } … … 594 590 if(!$this->is_ok($reply)) 595 591 { 596 $this->ERROR = _("POP3 delete:") . ' '. _("Command failed ") . "[$reply]";592 $this->ERROR = "POP3 delete: " . _("Command failed ") . "[$reply]"; 597 593 return false; 598 594 } … … 631 627 for($count =0; $count < $length; $count++) 632 628 { 633 $digit = substr($server_text, $count,1);634 if (!empty($digit)){629 $digit = substr($server_text,$count,1); 630 if(!empty($digit)) { 635 631 if( (!$outside) && ($digit != '<') && ($digit != '>') ) 636 632 { … … 652 648 653 649 } // End class 654 655 650 ?>
Note: See TracChangeset
for help on using the changeset viewer.