Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#9162 closed defect (bug) (fixed)

wp-mail.php is posting with a future timestamp

Reported by: lincolnadams Owned by:
Milestone: 2.8 Priority: normal
Severity: major Version: 2.7
Component: General Keywords: has-patch
Focuses: Cc:


WP-Mail is posting timestamp several hours into the future depending on one's time zone. The problem seems to be due to a line 130 of wp-mail.php:

$post_date = gmdate('Y-m-d H:i:s', $ddate_U + $time_difference);

The problem is those who have negative GMT time zones will see their postings made at future times instead of the correct times. Those who have postives GMT zones are probably not affected.

A temporary workaround is to modify $ddate_U + $time_difference); so that it subtracts instead of adds: $post_date = gmdate('Y-m-d H:i:s', $ddate_U - $time_difference);

However, a more permanent fix is needed.

Attachments (1)

mail_gmt_offset.patch (431 bytes) - added by Hirvine 9 years ago.
Removes absint

Download all attachments as: .zip

Change History (4)

9 years ago

Removes absint

#1 @Hirvine
9 years ago

The initial value of $time_difference seems to be the problem. Removing the absint seems to be safe regarding functions.php and formatting.php.

#2 @Denis-de-Bernardy
9 years ago

  • Keywords has-patch added; wp-mail removed

See: #9588. It's very likely related.

#3 @ryan
9 years ago

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

(In [11066]) Don't absint gmt_offset. Props Hirvine. fixes #9162

Note: See TracTickets for help on using tickets.