Merge "User: Avoid deprecated Linker::link()"
[lhc/web/wiklou.git] / includes / upload / UploadBase.php
index 2c0afdf..57bb22a 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 ) {
@@ -1411,7 +1411,9 @@ abstract class UploadBase {
                        'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd',
                        'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd',
                        'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd',
-                       'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd'
+                       'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd',
+                       // https://phabricator.wikimedia.org/T168856
+                       'http://www.w3.org/TR/2001/PR-SVG-20010719/DTD/svg10.dtd',
                ];
                if ( $type !== 'PUBLIC'
                        || !in_array( $systemId, $allowedDTDs )
@@ -2113,9 +2115,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 +2132,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 {