Merge "SpecialMovepage: Convert form to use OOUI controls"
[lhc/web/wiklou.git] / includes / upload / UploadBase.php
index 426c752..b06b91e 100644 (file)
@@ -752,6 +752,12 @@ abstract class UploadBase {
                if ( $this->mTitle !== false ) {
                        return $this->mTitle;
                }
+               if ( !is_string( $this->mDesiredDestName ) ) {
+                       $this->mTitleError = self::ILLEGAL_FILENAME;
+                       $this->mTitle = null;
+
+                       return $this->mTitle;
+               }
                /* Assume that if a user specified File:Something.jpg, this is an error
                 * and that the namespace prefix needs to be stripped of.
                 */
@@ -1935,7 +1941,7 @@ abstract class UploadBase {
        public static function getSessionStatus( User $user, $statusKey ) {
                $key = wfMemcKey( 'uploadstatus', $user->getId() ?: md5( $user->getName() ), $statusKey );
 
-               return wfGetCache( CACHE_ANYTHING )->get( $key );
+               return ObjectCache::getMainStashInstance()->get( $key );
        }
 
        /**
@@ -1951,7 +1957,7 @@ abstract class UploadBase {
        public static function setSessionStatus( User $user, $statusKey, $value ) {
                $key = wfMemcKey( 'uploadstatus', $user->getId() ?: md5( $user->getName() ), $statusKey );
 
-               $cache = wfGetCache( CACHE_ANYTHING );
+               $cache = ObjectCache::getMainStashInstance();
                if ( $value === false ) {
                        $cache->delete( $key );
                } else {