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:
parent
f4324499da
commit
cdc93a62bf
1 changed files with 2 additions and 1 deletions
|
|
@ -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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue