Opened 9 years ago
Last modified 5 years ago
#36738 new defect (bug)
No validation for $post_date_gmt parameter
Reported by: | Latz | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.5.1 |
Component: | Posts, Post Types | Keywords: | has-patch |
Focuses: | Cc: |
Description
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.
Attachments (1)
Note: See
TracTickets for help on using
tickets.
Realted: #36595