WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#5420 closed enhancement (fixed)

Better exit for wp-mail.php

Reported by: lexhair Owned by: westi
Milestone: 2.5 Priority: normal
Severity: minor Version: 2.3.1
Component: General Keywords: has-patch tested
Focuses: Cc:

Description

Executing wp-mail.php when the POP3 mailbox is empty results in wp_die() and a 500 error. When you run wp-mail.php from the cron tab, it logs the 500 error.

I don't believe it should return an error in this case. The script runs as it should and just doesn't find any data to manipulate like a zero row query. Perhaps a more graceful exit could be considered. Thank you.

Attachments (2)

wp-mail.diff (556 bytes) - added by Bobcat 8 years ago.
Don't return 500 error if no email
wp-mail.2.diff (796 bytes) - added by Bobcat 8 years ago.
Don't issue 500 error if no messages; Check for user/password failure

Download all attachments as: .zip

Change History (8)

@Bobcat8 years ago

Don't return 500 error if no email

comment:1 @Bobcat8 years ago

  • Keywords has-patch tested added
  • Milestone changed from 2.5 to 2.4

comment:2 @lexhair8 years ago

Thank you!

comment:3 @westi8 years ago

  • Owner changed from anonymous to westi
  • Status changed from new to assigned

@Bobcat8 years ago

Don't issue 500 error if no messages; Check for user/password failure

comment:4 @Bobcat8 years ago

A user/password failure would look just like there were no messages. New patch checks user/password status and fails with 500 error if either failed. If login is successful and there are no messages, just the 'no messages' message is displayed (no 500 error).

comment:5 @Bobcat8 years ago

Tested with WP 2.3.1, FreeBSD 6.2-RELEASE-p1, MySQL 4.1.20, with invalid username, invalid password, valid user/pass but no messages, valid user/pass with messages. Works correctly.

comment:6 @westi8 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

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

Note: See TracTickets for help on using tickets.