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

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8082754264
  • Loading branch information
donnchawp authored and matticbot committed Feb 28, 2024
1 parent 92c8ffc commit f8534f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ This is an alpha version! The changes listed here are not final.
### Fixed
- Supercache: add "days" to "Next preload scheduled" message.
- Super Cache: with rebuild enabled, apply that to subdirectories instead of deleting them.
- WP Super Cache: bail if the request uri isn't set. It means the plugin isn't configured yet.

## [1.11.0] - 2023-11-08
### Added
Expand Down
5 changes: 5 additions & 0 deletions 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 f8534f5

Please sign in to comment.