[wp-trac] [WordPress Trac] #56311: Week query variable is not being sanitized correctly

WordPress Trac noreply at wordpress.org
Thu Aug 11 09:05:17 UTC 2022


#56311: Week query variable is not being sanitized correctly
---------------------------+------------------------------
 Reporter:  domainsupport  |       Owner:  audrasjb
     Type:  defect (bug)   |      Status:  assigned
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Query          |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------

Comment (by domainsupport):

 == Testing Instructions
 I've added a patch to this ticket ...

 === Steps to Reproduce
 1. Go to /?day=1234 in any WordPress installation
 2. 🐞 Bug occurs.

 === Expected Results
 After installing the patch
 - ✅ No PHP warning should be seen in the log when you visit ...
 /?day=1234
 /?w=1234
 /?monthnum=1234
 /?hour=1234
 /?minute=1234
 /?second=1234

 When reproducing a bug:
 - ❌ `PHP Notice: Function WP_Date_Query was called
 <strong>incorrectly</strong>. Invalid value <code>1234</code> for
 <code>week</code>. Expected value should be between <code>1</code> and
 <code>53</code>. Please see <a href="https://wordpress.org/support/article
 /debugging-in-wordpress/">Debugging in WordPress</a> for more information.
 (This message was added in version 4.1.0.) in /wp-includes/functions.php
 on line 5831`

   **Test Report Icons:**
   🐞 <= Indicates where issue ("bug") occurs.
   ✅ <= Behavior is ''expected''.
   ❌ <= Behavior is ''NOT expected''.

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


More information about the wp-trac mailing list