Skip to content

Commit 98a44d1

Browse files
committed
unserialize values in incr/decr
related to #584 and #575
1 parent c280af6 commit 98a44d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

includes/object-cache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,7 +2410,7 @@ public function increment( $key, $offset = 1, $group = 'default' ) {
24102410
}
24112411

24122412
try {
2413-
$value = (int) $this->parse_redis_response( $this->redis->get( $derived_key ) );
2413+
$value = (int) $this->parse_redis_response( $this->maybe_unserialize( $this->redis->get( $derived_key )) );
24142414
$value += $offset;
24152415
$result = $this->parse_redis_response( $this->redis->set( $derived_key, $this->maybe_serialize( $value ) ) );
24162416

@@ -2472,7 +2472,7 @@ public function decrement( $key, $offset = 1, $group = 'default' ) {
24722472
}
24732473

24742474
try {
2475-
$value = (int) $this->parse_redis_response( $this->redis->get( $derived_key ) );
2475+
$value = (int) $this->parse_redis_response( $this->maybe_unserialize( $this->redis->get( $derived_key ) ) );
24762476
$value -= $offset;
24772477
$result = $this->parse_redis_response( $this->redis->set( $derived_key, $this->maybe_serialize( $value ) ) );
24782478

0 commit comments

Comments
 (0)