From 9f8c0f9e75bc1ff8d9344a7185b66536e42c2cdc Mon Sep 17 00:00:00 2001 From: Erick Hitter <ehitter@gmail.com> Date: Thu, 27 Feb 2014 12:17:29 -0800 Subject: [PATCH] Correct order of arguments passed to `setex()` as they were incorrect--the expiration and value to cache were inverted. Bug has existed since baa6de524 but was masked by serialization bug fixed in 01b7283c0. --- object-cache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/object-cache.php b/object-cache.php index 7571d96..d290a49 100644 --- a/object-cache.php +++ b/object-cache.php @@ -855,7 +855,7 @@ class WP_Object_Cache { // Save to Redis $expiration = absint( $expiration ); if ( $expiration ) { - $result = $this->redis->setex( $derived_key, $this->prepare_value_for_redis( $value ), $expiration ); + $result = $this->redis->setex( $derived_key, $expiration, $this->prepare_value_for_redis( $value ) ); } else { $result = $this->redis->set( $derived_key, $this->prepare_value_for_redis( $value ) ); } @@ -982,7 +982,7 @@ class WP_Object_Cache { // Save to Redis $expiration = absint( $expiration ); if ( $expiration ) { - $result = $this->redis->setex( $derived_key, $this->prepare_value_for_redis( $value ), $expiration ); + $result = $this->redis->setex( $derived_key, $expiration, $this->prepare_value_for_redis( $value ) ); } else { $result = $this->redis->set( $derived_key, $this->prepare_value_for_redis( $value ) ); } -- GitLab