[wp-trac] [WordPress Trac] #56338: `taxonomy_exists()` does not guard against non-string arguments.

WordPress Trac noreply at wordpress.org
Fri Aug 5 05:57:07 UTC 2022


#56338: `taxonomy_exists()` does not guard against non-string arguments.
--------------------------+----------------------
 Reporter:  costdev       |      Owner:  costdev
     Type:  defect (bug)  |     Status:  assigned
 Priority:  normal        |  Milestone:  6.1
Component:  Taxonomy      |    Version:
 Severity:  normal        |   Keywords:  php8
  Focuses:                |
--------------------------+----------------------
 Follow-up to #56336.

 While testing the issue reported by @dd32, I came across a similar
 warning/error. This can be produced, for example, when using Yoast SEO for
 sitemaps.

 {{{
 Warning: Illegal offset type in isset or empty in src/wp-
 includes/taxonomy.php on line 340
 }}}

 Tested and verified by @peterwilsoncc

 Adding an `is_string( $taxonomy )` check to the condition in
 [https://developer.wordpress.org/reference/functions/taxonomy_exists/
 taxonomy_exists] resolves the issue. The `$taxonomy` argument is
 documented as a `string`.

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


More information about the wp-trac mailing list