[wp-trac] [WordPress Trac] #55955: Setting a 'NOT EXISTS' tax query in 'pre_get_posts' action triggers a fatal error in wp-includes/canonical.php

WordPress Trac noreply at wordpress.org
Thu Nov 10 16:23:36 UTC 2022


#55955: Setting a 'NOT EXISTS' tax query in 'pre_get_posts' action triggers a fatal
error in wp-includes/canonical.php
-------------------------------------------------+-------------------------
 Reporter:  codesdnc                             |       Owner:
                                                 |  peterwilsoncc
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.1.1
Component:  Canonical                            |     Version:  6.0
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  php8 has-patch has-unit-tests        |     Focuses:
  commit fixed-major                             |
-------------------------------------------------+-------------------------
Changes (by desrosj):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"54793" 54793]:
 {{{
 #!CommitTicketReference repository="" revision="54793"
 Canonical: Protect against error for term not exists queries.

 Prevent term `NOT EXISTS` queries causing `redirect_canonical()` to throw
 a fatal error in PHP 8 and above, or a warning in earlier versions.

 This ensures the `tax_query`'s `terms` property both exists and is
 countable before attempting to count it.

 Props codesdnc, SergeyBiryukov, kadamwhite, costdev, miguelaxcar.
 Merges [54785] to the 6.1 branch.
 Fixes #55955.
 }}}

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


More information about the wp-trac mailing list