Merge "Improve docs for Title::getInternalURL/getCanonicalURL"
[lhc/web/wiklou.git] / includes / specials / SpecialUpload.php
index 836b6df..dcc35fc 100644 (file)
@@ -146,8 +146,7 @@ class SpecialUpload extends SpecialPage {
        }
 
        /**
-        * Special page entry point
-        * @param string $par
+        * @param string|null $par
         * @throws ErrorPageError
         * @throws Exception
         * @throws FatalError
@@ -192,11 +191,9 @@ class SpecialUpload extends SpecialPage {
                $this->loadRequest();
 
                # Unsave the temporary file in case this was a cancelled upload
-               if ( $this->mCancelUpload ) {
-                       if ( !$this->unsaveUploadedFile() ) {
-                               # Something went wrong, so unsaveUploadedFile showed a warning
-                               return;
-                       }
+               if ( $this->mCancelUpload && !$this->unsaveUploadedFile() ) {
+                       # Something went wrong, so unsaveUploadedFile showed a warning
+                       return;
                }
 
                # Process upload or show a form
@@ -324,7 +321,13 @@ class SpecialUpload extends SpecialPage {
                                );
                                $link = $this->msg( $user->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted' )
                                        ->rawParams( $restorelink )->parseAsBlock();
-                               $this->getOutput()->addHTML( "<div id=\"contentSub2\">{$link}</div>" );
+                               $this->getOutput()->addHTML(
+                                       Html::rawElement(
+                                               'div',
+                                               [ 'id' => 'contentSub2' ],
+                                               $link
+                                       )
+                               );
                        }
                }
        }
@@ -483,7 +486,7 @@ class SpecialUpload extends SpecialPage {
                // Fetch the file if required
                $status = $this->mUpload->fetchFile();
                if ( !$status->isOK() ) {
-                       $this->showUploadError( $this->getOutput()->parse( $status->getWikiText() ) );
+                       $this->showUploadError( $this->getOutput()->parseAsInterface( $status->getWikiText() ) );
 
                        return;
                }
@@ -553,7 +556,9 @@ class SpecialUpload extends SpecialPage {
                        $changeTagsStatus = ChangeTags::canAddTagsAccompanyingChange(
                                $changeTags, $this->getUser() );
                        if ( !$changeTagsStatus->isOK() ) {
-                               $this->showUploadError( $this->getOutput()->parse( $changeTagsStatus->getWikiText() ) );
+                               $this->showUploadError( $this->getOutput()->parseAsInterface(
+                                       $changeTagsStatus->getWikiText()
+                               ) );
 
                                return;
                        }
@@ -568,7 +573,9 @@ class SpecialUpload extends SpecialPage {
                );
 
                if ( !$status->isGood() ) {
-                       $this->showRecoverableUploadError( $this->getOutput()->parse( $status->getWikiText() ) );
+                       $this->showRecoverableUploadError(
+                               $this->getOutput()->parseAsInterface( $status->getWikiText() )
+                       );
 
                        return;
                }