[wp-trac] [WordPress Trac] #18361: get_gmt_from_date() returns incorrect time for "0000-00-00 00:00:00"
WordPress Trac
wp-trac at lists.automattic.com
Tue Aug 9 16:45:26 UTC 2011
#18361: get_gmt_from_date() returns incorrect time for "0000-00-00 00:00:00"
-----------------------------+-----------------------------
Reporter: danielbachhuber | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Date/Time | Version:
Severity: normal | Keywords:
-----------------------------+-----------------------------
When you pass "0000-00-00 00:00:00" to get_gmt_from_date(), it returns the
current time with GMT offset. Instead it should return the original
nonsense time (possibly altering format if there's an alternate time
format referenced).
Backstory: We have a plugin that allows users to create custom statuses.
It uses the partially completed custom status API and additional code
we've written. In the WordPress.org forum, a
[http://wordpress.org/support/topic/plugin-edit-flow-custom-statuses-
create-timestamp-problem bug was reported] where if they use a custom
status with a post, the post time is set. Currently, they have to manually
edit the timestamp of the post before publishing in order for it to be set
to the proper publication date (instead of 5 days ago when they originally
created it).
The origin of the problem is
[http://core.trac.wordpress.org/browser/tags/3.2.1/wp-
includes/post.php#L2506 line #2506 in wp-includes/post.php]. The post
statuses to receive timestamps should be whitelisted instead of
blacklisted. Because the custom statuses aren't a part of the blacklist,
they receive a GMT timesteamp.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18361>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list