RedisBagOStuff: Fix unserialization of negative numbers

ctype_digit( $data ) doesn't return true if $data is
a negative integer.

Bug: T134923
Change-Id: Ie8a23fc6354a15210e010062e3da3058f4c463bb
This commit is contained in:
Brad Jorsch 2016-05-11 20:49:21 -07:00 committed by Roan Kattouw
parent f4324499da
commit cdc93a62bf

View file

@ -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 );
}
/**