From cdc93a62bf958702f6a54633ea65d289ab4713b8 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Wed, 11 May 2016 20:49:21 -0700 Subject: [PATCH] RedisBagOStuff: Fix unserialization of negative numbers ctype_digit( $data ) doesn't return true if $data is a negative integer. Bug: T134923 Change-Id: Ie8a23fc6354a15210e010062e3da3058f4c463bb --- includes/objectcache/RedisBagOStuff.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/objectcache/RedisBagOStuff.php b/includes/objectcache/RedisBagOStuff.php index 61e6926c85..90508dac5f 100644 --- a/includes/objectcache/RedisBagOStuff.php +++ b/includes/objectcache/RedisBagOStuff.php @@ -310,7 +310,8 @@ class RedisBagOStuff extends BagOStuff { * @return mixed */ protected function unserialize( $data ) { - return ctype_digit( $data ) ? intval( $data ) : unserialize( $data ); + $int = intval( $data ); + return $data === (string)$int ? $int : unserialize( $data ); } /** -- 2.20.1