[wp-trac] [WordPress Trac] #28992: mysql2date() return empty string not false sometimes added doing it wrong message
WordPress Trac
noreply at wordpress.org
Thu Aug 29 16:37:06 UTC 2019
#28992: mysql2date() return empty string not false sometimes added doing it wrong
message
--------------------------------------+-----------------------------
Reporter: pbearne | Owner: SergeyBiryukov
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 5.3
Component: Date/Time | Version: 3.8
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+-----------------------------
Comment (by SergeyBiryukov):
Replying to [comment:19 SergeyBiryukov]:
> The first result is for `invalid_date` (with underscore), the second is
for `invalid date` (with a space).
Ah, looks like it's not that. It's because the first test is for
`post_date` and the second one is for `post_date_gmt`, which is handled
differently if an invalid date is passed.
The resulting post data before [45908]:
{{{
post_date: 1970-01-01 00:00:00
post_date_gmt: 1970-01-01 00:00:00
}}}
After [45908]:
{{{
post_date: 2019-08-29 05:13:46
post_date_gmt: 0000-00-00 00:00:00
}}}
There's some logic in [source:tags/5.2.2/src/wp-includes/class-wp-xmlrpc-
server.php#L835 convert_date_gmt()] to deal with the latter case.
Still, as the tests were originally meant to check for the lack of a fatal
error, not specifically mark a particular outcome as the correct one, I
agree with updating the tests.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28992#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list