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

WordPress Trac noreply at wordpress.org
Thu Jan 19 09:33:54 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        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 First, if URL is "/category/cat1/0", first, it is recognized as
 `category_name="cat1/0"`,
 then "is_category=true" and category archive template should be selected.

 But for really query, `category_name="0"` and
 `empty($q["category_name"])==true`,
 so it is recognized as "category is not specified", then `tax_query` will
 be empty, and `queried_object==null`.

 Finally, category template will be confused.
 No category is selected, any category related information are broken
 (maybe rise warnings or errors).
 Any recent posts of any public post types will be displayed even if its
 post_type dose not belong to core 'category' taxonomy.

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


More information about the wp-trac mailing list