[wp-trac] [WordPress Trac] #41011: get_calendar generates query with invalid date formats

WordPress Trac noreply at wordpress.org
Mon Jun 12 14:13:05 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        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by andy):

 The overarching problem with this code block is that it relies on MySQL
 for date computation that can and should be done in PHP. MySQL's date
 computation may have been more convenient when `get_calendar` was written
 14 years ago in [508]. PHP's date capabilities have improved since then,
 including support for ISO-8601 date formats.

 Along with validating the inputs mentioned in the ticket description, the
 code should be rewritten to stop using MySQL to find the calendar month
 for week queries.

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


More information about the wp-trac mailing list