jenkins-bot has submitted this change and it was merged.

Change subject: RedisBagOStuff: Fix unserialization of negative numbers
......................................................................


RedisBagOStuff: Fix unserialization of negative numbers

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

Bug: T134923
Change-Id: Ie8a23fc6354a15210e010062e3da3058f4c463bb
---
M includes/objectcache/RedisBagOStuff.php
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/objectcache/RedisBagOStuff.php 
b/includes/objectcache/RedisBagOStuff.php
index 61e6926..90508da 100644
--- a/includes/objectcache/RedisBagOStuff.php
+++ b/includes/objectcache/RedisBagOStuff.php
@@ -310,7 +310,8 @@
         * @return mixed
         */
        protected function unserialize( $data ) {
-               return ctype_digit( $data ) ? intval( $data ) : unserialize( 
$data );
+               $int = intval( $data );
+               return $data === (string)$int ? $int : unserialize( $data );
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/288343
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie8a23fc6354a15210e010062e3da3058f4c463bb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to