[wp-trac] [WordPress Trac] #57505: cagegory archive url ending with "/0" should be 404

WordPress Trac noreply at wordpress.org
Wed Feb 15 05:55:09 UTC 2023


#57505: cagegory archive url ending with "/0" should be 404
--------------------------+------------------------------
 Reporter:  obache        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by obache):

 questioned codes in `WP_Query::parse_tax_query()`.

 {{{#!php
                         if ( $t->query_var && ! empty( $q[ $t->query_var ]
 ) ) {
 }}}

 whereas `$t->query_var` is 'category_name', and `$q['category_name']` is
 0;

 should it be `strlen( $q[ $t->query_var ] ) > 0` instead of `! empty( $q[
 $t->query_var ] )` ?

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


More information about the wp-trac mailing list