From f63d34e3e3557d9309df223bfe6144477f0afdd1 Mon Sep 17 00:00:00 2001 From: audrasjb Date: Tue, 9 Aug 2022 10:23:13 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@53869 git-svn-id: http://core.svn.wordpress.org/trunk@53428 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 76a9ada576..6374d73bfa 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -337,7 +337,7 @@ function get_taxonomy( $taxonomy ) { function taxonomy_exists( $taxonomy ) { global $wp_taxonomies; - return isset( $wp_taxonomies[ $taxonomy ] ); + return is_string( $taxonomy ) && isset( $wp_taxonomies[ $taxonomy ] ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 780f239318..2433330603 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-53868'; +$wp_version = '6.1-alpha-53869'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.