[wp-trac] [WordPress Trac] #54186: Cast string to int in `wp_checkdate`

WordPress Trac noreply at wordpress.org
Sun Sep 11 21:56:59 UTC 2022


#54186: Cast string to int in `wp_checkdate`
--------------------------+------------------------------
 Reporter:  swissspidy    |       Owner:  swissspidy
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Date/Time     |     Version:
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------
Changes (by swissspidy):

 * owner:  (none) => swissspidy
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"54126" 54126]:
 {{{
 #!CommitTicketReference repository="" revision="54126"
 Date/Time: Cast extracted strings to integers in `wp_resolve_post_date()`.

 `wp_resolve_post_date()` extracts year/month/day from a post date (which
 is a string) and passes it to `wp_checkdate` (and from there to
 `checkdate()`), which requires `int`s.

 Casting the strings to integers avoids PHP notices due to incorrect
 argument types.

 Props hilayt24.
 Fixes #54186
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54186#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list