Skip to content

Commit

Permalink
Check for null string before escaping
Browse files Browse the repository at this point in the history
This avoids a `ltrim(): Passing null to parameter #1 ($string) of type string is deprecated` notice on PHP 8.1.
  • Loading branch information
iandunn authored Dec 7, 2023
1 parent 92993a8 commit ab983e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wp-cache-phase2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ab983e7

Please sign in to comment.