From 46ecc8e291ce5d5eea99e4580386b5923b6fc0cf Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 14 May 2016 04:03:39 -0700 Subject: [PATCH] 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 --- includes/user/User.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- 2.20.1