[wp-trac] [WordPress Trac] #13163: Incorrect POP3 error messages in wp-mail.php
WordPress Trac
wp-trac at lists.automattic.com
Wed Apr 28 09:12:28 UTC 2010
#13163: Incorrect POP3 error messages in wp-mail.php
---------------------------+------------------------------------------------
Reporter: solarissmoke | Owner: westi
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.0
Component: Blog by Email | Version: 3.0
Severity: normal | Keywords:
---------------------------+------------------------------------------------
The current code in wp-mail.php is:
{{{
$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) );
}
}}}
Because of the multiple OR statements, if one of the first two fails
(i.e., connect() or user() ) then the pass() function is never called and
$count is never changed from the initial 0. Thus (0 === $count) always
evaluates to true in these cases, giving an incorrect error message. e.g.,
if the connection failed, you still get "there doesn't seem to be any new
mail" instead of the POP3 error.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/13163>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list