Adjust POP3 error checks in wp-mail.php. props solarissmoke, fixes #13163.

git-svn-id: https://develop.svn.wordpress.org/trunk@14518 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-05-08 19:34:59 +00:00
parent f04386cca0
commit 00ae9bee64
1 changed files with 11 additions and 6 deletions

View File

@ -35,13 +35,18 @@ $time_difference = get_option('gmt_offset') * 3600;
$phone_delim = '::';
$pop3 = new POP3();
$count = 0;
if ( ! $pop3->connect(get_option('mailserver_url'), get_option('mailserver_port') ) ||
! $pop3->user(get_option('mailserver_login')) ||
( ! $count = $pop3->pass(get_option('mailserver_pass')) ) ) {
$pop3->quit();
wp_die( ( 0 === $count ) ? __('There doesn’t seem to be any new mail.') : esc_html($pop3->ERROR) );
if ( !$pop3->connect( get_option('mailserver_url'), get_option('mailserver_port') ) || !$pop3->user( get_option('mailserver_login') ) )
wp_die( esc_html( $pop3->ERROR ) );
$count = $pop3->pass( get_option('mailserver_pass') );
if( false === $count )
wp_die( esc_html( $pop3->ERROR ) );
if( 0 === $count ) {
$pop3->quit();
wp_die( __('There doesn’t seem to be any new mail.') );
}
for ( $i = 1; $i <= $count; $i++ ) {