From 20fbc7416bc25e5adae01f20bc955279db43dcc6 Mon Sep 17 00:00:00 2001 From: godog <godog@autistici.org> Date: Sat, 30 Sep 2017 16:05:26 +0200 Subject: [PATCH] wp-super-cache: don't write timestamp cache in config file Fixes ai/issues#104 --- .../plugins/wp-super-cache/wp-cache-phase2.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/wp-content/plugins/wp-super-cache/wp-cache-phase2.php b/wp-content/plugins/wp-super-cache/wp-cache-phase2.php index 41fb0c661..f8232d09f 100644 --- a/wp-content/plugins/wp-super-cache/wp-cache-phase2.php +++ b/wp-content/plugins/wp-super-cache/wp-cache-phase2.php @@ -3082,6 +3082,7 @@ function wp_cache_gc_watcher() { } } + if ( ! function_exists( 'apache_request_headers' ) ) { /** * A fallback for get request headers. @@ -3102,3 +3103,17 @@ if ( ! function_exists( 'apache_request_headers' ) ) { return $headers; } } + +/* + * Do not write the blog timestamp in the config file. + * wp-cache-config.php isn't writable by 'noblogs' user. + * https://git.autistici.org/ai/issues/issues/104 + +function wpsc_timestamp_cache_update( $type, $permalink ) { + wp_cache_setting( 'wpsc_last_post_update', time() ); +} +add_action( 'gc_cache', 'wpsc_timestamp_cache_update', 10, 2 ); + +*/ + +?> -- GitLab