Skip to content

Commit 7e365fd

Browse files
authored
Merge pull request #1013 from cloudinary/fix/util-deprecation-notice-php83
Fix: Deprecation notices in `Utils::is_rest_api`
2 parents 389d108 + 9f9e1ef commit 7e365fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

php/class-utils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ public static function is_rest_api() {
574574
// Fallback if rest engine is not setup yet.
575575
$rest_base = wp_parse_url( static::rest_url( '/' ), PHP_URL_PATH );
576576
$request_uri = filter_input( INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_URL );
577-
$is = strpos( $request_uri, $rest_base ) === 0;
577+
$is = is_string( $request_uri ) && strpos( $request_uri, $rest_base ) === 0;
578578
}
579579

580580
return $is;

0 commit comments

Comments
 (0)