Commit 9f8c0f9e authored by Erick Hitter's avatar Erick Hitter
Browse files

Correct order of arguments passed to `setex()` as they were incorrect--the...

Correct order of arguments passed to `setex()` as they were incorrect--the expiration and value to cache were inverted.

Bug has existed since baa6de52 but was masked by serialization bug fixed in 01b7283c.
parent e2c1e97c
......@@ -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 ) );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment