[wp-trac] [WordPress Trac] #62828: Array should not be passed to get_page_by_path()

WordPress Trac noreply at wordpress.org
Wed Apr 9 01:33:44 UTC 2025


#62828: Array should not be passed to get_page_by_path()
--------------------------+------------------------------
 Reporter:  leedxw        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  6.7.2
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by dd32):

 A simpler fix might be to do this instead, as it'll avoid making the
 existing selection branch more complex.

 {{{#!diff
         // This is the potentially clashing slug.
         $value = '';
 -       if ( $compare && array_key_exists( $compare, $query_vars ) ) {
 +       if ( $compare && array_key_exists( $compare, $query_vars ) &&
 is_scalar( $query_vars[ $compare ] ) ) {
                 $value = $query_vars[ $compare ];
         }
 }}}

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


More information about the wp-trac mailing list