Make WordPress Core


Ignore:
Timestamp:
08/09/2022 10:21:32 AM (2 years ago)
Author:
audrasjb
Message:

Taxonomy: Prevent non string taxonomy names generating warnings or errors.

This changeset adds an is_string( $taxonomy ) check to the condition in taxonomy_exists(), to ensure false is returned when the $taxonomy is not a string.

Follow-up to [35718].

Props costdev, peterwilsoncc, mukesh27.
Fixes #56338.
See #56336.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/taxonomy.php

    r53827 r53869  
    338338    global $wp_taxonomies;
    339339
    340     return isset( $wp_taxonomies[ $taxonomy ] );
     340    return is_string( $taxonomy ) && isset( $wp_taxonomies[ $taxonomy ] );
    341341}
    342342
Note: See TracChangeset for help on using the changeset viewer.