Ensure wp-mail doesn't issue a 500 error if no messages are available to post. Fixed #5420 props Bobcat

git-svn-id: http://svn.automattic.com/wordpress/trunk@6357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2007-12-05 07:39:07 +00:00
parent 63c48d25b9
commit 80f85b53e3
1 changed files with 7 additions and 2 deletions

View File

@ -14,9 +14,14 @@ $pop3 = new POP3();
if (!$pop3->connect(get_option('mailserver_url'), get_option('mailserver_port')))
wp_die($pop3->ERROR);
$count = $pop3->login(get_option('mailserver_login'), get_option('mailserver_pass'));
if (0 == $count) wp_die(__('There doesn’t seem to be any new mail.'));
if (!$pop3->user(get_option('mailserver_login')))
wp_die($pop3->ERROR);
$count = $pop3->pass(get_option('mailserver_pass'));
if (false === $count)
wp_die($pop3->ERROR);
if (0 == $count)
echo "<p>There doesn't seem to be any new mail.</p>\n"; // will fall-through to end of for loop
for ($i=1; $i <= $count; $i++) :