Skip to content

Commit ebc74d8

Browse files
committedNov 28, 2018
fix potential fatal error
1 parent 90c46bb commit ebc74d8

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed
 

‎CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 1.4.1
4+
5+
* Fixed potential fatal error related to `wp_suspend_cache_addition()`
6+
7+
## 1.4.0
8+
9+
* Added support for igbinary
10+
* Added support for `wp_suspend_cache_addition()`
11+
312
## 1.3.9
413

514
* Fixed `WP_REDIS_SHARDS` not showing up in server list

‎includes/object-cache.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Redis Object Cache Drop-In
44
Plugin URI: http://wordpress.org/plugins/redis-cache/
55
Description: A persistent object cache backend powered by Redis. Supports Predis, PhpRedis, HHVM, replication, clustering and WP-CLI.
6-
Version: 1.4.0
6+
Version: 1.4.1
77
Author: Till Krüss
88
Author URI: https://till.im/
99
License: GPLv3
@@ -581,7 +581,11 @@ public function replace($key, $value, $group = 'default', $expiration = 0)
581581
*/
582582
protected function add_or_replace($add, $key, $value, $group = 'default', $expiration = 0)
583583
{
584-
if ( $add && wp_suspend_cache_addition() ) {
584+
$cache_addition_suspended = function_exists('wp_suspend_cache_addition')
585+
? wp_suspend_cache_addition()
586+
: false;
587+
588+
if ( $add && $cache_addition_suspended ) {
585589
return false;
586590
}
587591

‎readme.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/tillkruss
44
Tags: redis, predis, phpredis, hhvm, pecl, caching, cache, object cache, performance, replication, clustering
55
Requires at least: 3.3
66
Tested up to: 5.0
7-
Stable tag: 1.4.0
7+
Stable tag: 1.4.1
88
License: GPLv3
99
License URI: http://www.gnu.org/licenses/gpl-3.0.html
1010

‎redis-cache.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Redis Object Cache
44
Plugin URI: https://wordpress.org/plugins/redis-cache/
55
Description: A persistent object cache backend powered by Redis. Supports Predis, PhpRedis, HHVM, replication, clustering and WP-CLI.
6-
Version: 1.4.0
6+
Version: 1.4.1
77
Text Domain: redis-cache
88
Domain Path: /languages
99
Author: Till Krüss

0 commit comments

Comments
 (0)
Please sign in to comment.