diff --git a/CHANGELOG.md b/CHANGELOG.md index fbf44858..e311fa54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ This is an alpha version! The changes listed here are not final. - WP Super Cache: Updated banner designs, added auto-install Jetpack Boost buttons ### Fixed +- Detect when WP_CACHE is defined with "const" in wp-config.php - Super Cache: Align detection of Boost installs with activation of that plugin - Super Cache: fixed a PHP warning when deactivating the plugin. - Super Cache: make sure plugins links is an array before using it. diff --git a/wp-cache.php b/wp-cache.php index 1768e783..ddd92060 100644 --- a/wp-cache.php +++ b/wp-cache.php @@ -2385,6 +2385,19 @@ function wp_cache_check_global_config() { $global_config_file = dirname( ABSPATH ) . '/wp-config.php'; } + if ( preg_match( '#^\s*(define\s*\(\s*[\'"]WP_CACHE[\'"]|const\s+WP_CACHE\s*=)#m', file_get_contents( $global_config_file ) ) === 1 ) { // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents + if ( defined( 'WP_CACHE' ) && ! constant( 'WP_CACHE' ) ) { + ?> +
define('WP_CACHE', true);