[wp-trac] [WordPress Trac] #25834: WP_Date_Query not allowed values possible

WordPress Trac noreply at wordpress.org
Sun Feb 23 19:22:50 UTC 2014


#25834: WP_Date_Query not allowed values possible
------------------------------------------+------------------
 Reporter:  ChriCo                        |       Owner:
     Type:  defect (bug)                  |      Status:  new
 Priority:  normal                        |   Milestone:  3.9
Component:  Query                         |     Version:  3.7
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+------------------

Comment (by ChriCo):

 i've attached a .diff-File for validating the date_query-values and some
 unit-tests.

 I agree that it would be not the best solution to return an Error-Object
 or break the Query, but it would be nice to trigger an error (on WP_DEBUG
 === true) when some parameters are invalid.

 The Method validate_date_values( Array $date_query = array() ); is a
 public Method, So it could be resued in other WordPress-Functions
 (wp_insert_post(), wp_insert_commert(), .. ) when Date-Inputs should be
 validated.

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


More information about the wp-trac mailing list