[wp-trac] [WordPress Trac] #59235: AJAX request returns critical error in class-wp-date-query.php

WordPress Trac noreply at wordpress.org
Mon Oct 30 21:34:07 UTC 2023


#59235: AJAX request returns critical error in class-wp-date-query.php
-------------------------------+------------------------------
 Reporter:  reklwera           |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Query              |     Version:  4.1
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by hellofromTonya):

 * keywords:  has-patch => reporter-feedback
 * focuses:  php-compatibility =>
 * version:  trunk => 4.1


Comment:

 Hello @reklwera,

 Welcome to WordPress Core's Trac :)

 As @jrf noted in comment:2, a full backtrace is needed to find the root
 cause:
 >Primarily this is a case of incorrect input being passed to the date
 query, so this needs a backtrace and should be solved at the point where
 the incorrect data is being passed.

 There are good suggestions in the PR for better defensive guarding, such
 as dealing with `false` returned from `reset()`.

 I agree with @jrf that `_doing_it_wrong()` or `wp_trigger_error()` are
 appropriate to avoid silently bailing out or handling incorrect given
 inputs.

 Any code changes will also need unit tests.

 Ticket updates:
 * `Version`: The code was introduced during 4.1 via [31396] / #31001.
 * Keywords: Removing `has-patch` as the PR is now closed and its branch
 deleted.
 * Focus: `php-compatibility` keyword is reserved for denoting
 incompatibilities with a specific PHP version. When there's an
 incompatibility, it pairs with the `phpNN` keyword.
 [https://make.wordpress.org/core/handbook/contribute/trac/keywords/ See
 the handbook.]

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


More information about the wp-trac mailing list