From 316641798f502f5a576796758ffef12c45182da3 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 25 May 2017 00:47:56 -0700 Subject: [PATCH] UploadBase: Avoid deprecated wfMemcKey() Change-Id: I717948d6550ed2d98c3a89b3e48e161c3af15d48 --- includes/upload/UploadBase.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 55fb68529f..0868ce669e 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -2113,9 +2113,10 @@ abstract class UploadBase { * @return Status[]|bool */ public static function getSessionStatus( User $user, $statusKey ) { - $key = wfMemcKey( 'uploadstatus', $user->getId() ?: md5( $user->getName() ), $statusKey ); + $cache = MediaWikiServices::getInstance()->getMainObjectStash(); + $key = $cache->makeKey( 'uploadstatus', $user->getId() ?: md5( $user->getName() ), $statusKey ); - return MediaWikiServices::getInstance()->getMainObjectStash()->get( $key ); + return $cache->get( $key ); } /** @@ -2129,9 +2130,9 @@ abstract class UploadBase { * @return void */ public static function setSessionStatus( User $user, $statusKey, $value ) { - $key = wfMemcKey( 'uploadstatus', $user->getId() ?: md5( $user->getName() ), $statusKey ); - $cache = MediaWikiServices::getInstance()->getMainObjectStash(); + $key = $cache->makeKey( 'uploadstatus', $user->getId() ?: md5( $user->getName() ), $statusKey ); + if ( $value === false ) { $cache->delete( $key ); } else { -- 2.20.1