#54186 closed defect (bug) (fixed)
Cast string to int in `wp_checkdate`
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.1 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Date/Time | Keywords: | has-patch |
| Focuses: | Cc: |
Description
I am currently getting some PHP warnings when running integration tests against core:
PHP Warning: checkdate() expects parameter 1 to be int, string given in /tmp/wordpress/wp-includes/functions.php on line 6903
As it turns out, 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 ints.
To avoid these warnings, the input arguments should be cast to integers.
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Explicitly converted the strings to the integer