From: Aaron Schulz Date: Sat, 14 May 2016 11:03:39 +0000 (-0700) Subject: Add "mVersion" sanity check to User::loadFromCache() X-Git-Tag: 1.31.0-rc.0~6960^2 X-Git-Url: https://git.cyclocoop.org/admin/%7B%7Blocalurl:Special:UserLogin%7D%7D?a=commitdiff_plain;h=46ecc8e291ce5d5eea99e4580386b5923b6fc0cf;p=lhc%2Fweb%2Fwiklou.git Add "mVersion" sanity check to User::loadFromCache() This makes it easier to transition to a newer, versioned key format while still using Het Deploy as normal. Change-Id: I732af860ba4ea70cc7d1cc5bf46fc09fc35d7502 --- diff --git a/includes/user/User.php b/includes/user/User.php index b5384bc90f..6bfc3a4a02 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -499,7 +499,10 @@ class User implements IDBAccessObject { $data = $processCache->get( $key ); if ( !is_array( $data ) ) { $data = $cache->get( $key ); - if ( !is_array( $data ) || $data['mVersion'] < self::VERSION ) { + if ( !is_array( $data ) + || !isset( $data['mVersion'] ) + || $data['mVersion'] < self::VERSION + ) { // Object is expired return false; }