[wp-trac] [WordPress Trac] #36738: No validation for $post_date_gmt parameter
WordPress Trac
noreply at wordpress.org
Tue May 3 11:53:01 UTC 2016
#36738: No validation for $post_date_gmt parameter
-------------------------------+-----------------------------
Reporter: Latz | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: 4.5.1
Severity: normal | Keywords:
Focuses: |
-------------------------------+-----------------------------
1) When publishing a post via `wp_insert_post()`and the `$post_date_gmt`
parameter has a wrong format it's silently set to `0000-00-00 00:00:00`.
2) If `$post_date` is omitted in the parameter array WP tries to determine
it from `$post_date_gmt`. A wrong formatted `$post_date_gmt` leads to a
`post_date` of `1970-01-01 00:00:00`.
Just like `$post_date`it should throw an error to give a programmer the
right hint for his malfunctioning code.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36738>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list