Skip to content

Commit

Permalink
[Super Cache] exit the cache system if request uri is not set (#36024)
Browse files Browse the repository at this point in the history
* Bail if the request_uri isn't set up here.

* changelog
  • Loading branch information
donnchawp authored Feb 28, 2024
1 parent d6b9a81 commit 002ed26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

WP Super Cache: bail if the request uri isn't set. It means the plugin isn't configured yet.
5 changes: 5 additions & 0 deletions projects/plugins/super-cache/wp-cache-phase2.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,11 @@ function wp_cache_postload() {
global $cache_enabled, $wp_super_cache_late_init;
global $wp_cache_request_uri;

if ( empty( $wp_cache_request_uri ) ) {
wp_cache_debug( 'wp_cache_postload: no request uri configured. Not running.' );
return false;
}

// 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 ) );

Expand Down

0 comments on commit 002ed26

Please sign in to comment.