wp/wp-includes/sitemaps/class-wp-sitemaps-registry.php
changeset 21 48c4eec2b7e6
parent 16 a86126ab1dd4
--- a/wp/wp-includes/sitemaps/class-wp-sitemaps-registry.php	Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-includes/sitemaps/class-wp-sitemaps-registry.php	Fri Sep 05 18:40:08 2025 +0200
@@ -14,6 +14,7 @@
  *
  * @since 5.5.0
  */
+#[AllowDynamicProperties]
 class WP_Sitemaps_Registry {
 	/**
 	 * Registered sitemap providers.
@@ -65,7 +66,7 @@
 	 * @return WP_Sitemaps_Provider|null Sitemap provider if it exists, null otherwise.
 	 */
 	public function get_provider( $name ) {
-		if ( ! isset( $this->providers[ $name ] ) ) {
+		if ( ! is_string( $name ) || ! isset( $this->providers[ $name ] ) ) {
 			return null;
 		}