[wp-trac] [WordPress Trac] #41011: get_calendar generates query with invalid date formats
WordPress Trac
noreply at wordpress.org
Mon Jun 12 13:51:13 UTC 2017
#41011: get_calendar generates query with invalid date formats
--------------------------+-----------------------------
Reporter: andy | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Given a parameter like `?w=1400`, which is obviously not a week number,
`get_calendar` will try to compute the date 9799 days into the year. It
would make sense to check that `$w` is in a valid range, such as not
greater than 53.
At the same time, `get_calendar` does not check that `$m` is a valid date,
resulting in `$thisyear == '0'` and a query of `SELECT
DATE_FORMAT((DATE_ADD('00101', INTERVAL 9799 DAY) ), '%m')`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41011>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list