From 9f9e1efbe71258c0b1fe1a918e8194613d9ac16f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Polakovi=C4=8D?= Date: Thu, 23 Jan 2025 16:45:03 +0100 Subject: [PATCH] Fix deprecation notices in Utils::is_rest_api. --- php/class-utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-utils.php b/php/class-utils.php index 0f774118b..4c6569e29 100644 --- a/php/class-utils.php +++ b/php/class-utils.php @@ -574,7 +574,7 @@ public static function is_rest_api() { // Fallback if rest engine is not setup yet. $rest_base = wp_parse_url( static::rest_url( '/' ), PHP_URL_PATH ); $request_uri = filter_input( INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_URL ); - $is = strpos( $request_uri, $rest_base ) === 0; + $is = is_string( $request_uri ) && strpos( $request_uri, $rest_base ) === 0; } return $is;