X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fupload%2FUploadBase.php;h=0868ce669ea0dfe06eb199a65998ec5b0f4e5992;hb=316641798f502f5a576796758ffef12c45182da3;hp=2c0afdf00f8f55338cfd40a2e6e8d21861d74fbf;hpb=6fbafe5494440f5c37686b250ed759f6a96271b9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 2c0afdf00f..0868ce669e 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -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 {