From d9f1a93f78cd785cb0c06a0ba4a5222e57187aab Mon Sep 17 00:00:00 2001 From: Charles El-Mir Date: Mon, 13 Mar 2017 22:51:19 -0400 Subject: [PATCH] Fix for Object Cache 'Get' method incorrectly setting cache value --- ObjectCache_WpObjectCache_Regular.php | 2 +- README.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ObjectCache_WpObjectCache_Regular.php b/ObjectCache_WpObjectCache_Regular.php index 9cc558e..d726bd8 100644 --- a/ObjectCache_WpObjectCache_Regular.php +++ b/ObjectCache_WpObjectCache_Regular.php @@ -191,10 +191,10 @@ function get( $id, $group = 'default', $force = false, &$found = null ) { $found = ( $value !== false ); } - $this->cache[$key] = $value; $this->cache_total++; if ( $value !== false ) { + $this->cache[$key] = $value; $this->cache_hits++; } else { $this->cache_misses++; diff --git a/README.md b/README.md index a661c02..550e738 100644 --- a/README.md +++ b/README.md @@ -82,3 +82,4 @@ Type | More Information | :beetle: Bug Fix | [Closure Compiler fix for JAVA path](https://github.com/szepeviktor/w3-total-cache-fixed/pull/428) | :beetle: Bug Fix | [Fixed Redis Test on Admin Dashboard](https://github.com/szepeviktor/w3-total-cache-fixed/pull/430) | :cyclone: New Feature | [Extends "http 2 push" to page cache enhanced](https://github.com/szepeviktor/w3-total-cache-fixed/pull/433) | +:beetle: Bug Fix | [Fixed Object Cache setting cache value on missed gets](https://github.com/szepeviktor/w3-total-cache-fixed/issues/438) |