From ab983e74b5da1c332e9f99aa93b0679171d4532f Mon Sep 17 00:00:00 2001 From: Ian Dunn Date: Thu, 7 Dec 2023 07:31:57 -0800 Subject: [PATCH] Check for null string before escaping This avoids a `ltrim(): Passing null to parameter #1 ($string) of type string is deprecated` notice on PHP 8.1. --- wp-cache-phase2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-cache-phase2.php b/wp-cache-phase2.php index 9c54a1e2..70dd8a55 100644 --- a/wp-cache-phase2.php +++ b/wp-cache-phase2.php @@ -391,7 +391,7 @@ function wp_cache_postload() { global $wp_cache_request_uri; // have to sanitize here because formatting.php is loaded after wp_cache_request_uri is set - $wp_cache_request_uri = esc_url_raw( wp_unslash( $wp_cache_request_uri ) ); + $wp_cache_request_uri = esc_url_raw( wp_unslash( $wp_cache_request_uri ? $wp_cache_request_uri : '' ) ); if ( ! $cache_enabled ) { return true;