UploadBase: Avoid deprecated wfMemcKey()
[lhc/web/wiklou.git] / includes / upload / UploadBase.php
index 2c0afdf..0868ce6 100644 (file)
@@ -798,7 +798,7 @@ abstract class UploadBase {
         * Returns the title of the file to be uploaded. Sets mTitleError in case
         * the name was illegal.
         *
-        * @return Title The title of the file or null in case the name was illegal
+        * @return Title|null The title of the file or null in case the name was illegal
         */
        public function getTitle() {
                if ( $this->mTitle !== false ) {
@@ -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 {