From 1d8718e03ddc1617fc28a9e4632a308da2cc9c85 Mon Sep 17 00:00:00 2001 From: nacin Date: Sat, 8 May 2010 19:34:59 +0000 Subject: [PATCH] Adjust POP3 error checks in wp-mail.php. props solarissmoke, fixes #13163. git-svn-id: http://svn.automattic.com/wordpress/trunk@14518 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-mail.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/wp-mail.php b/wp-mail.php index a50bf0fe1a..8e30dbfb2d 100644 --- a/wp-mail.php +++ b/wp-mail.php @@ -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++ ) {