Merge "Language::convertPlural: check if matching form exists"
[lhc/web/wiklou.git] / includes / specials / SpecialUndelete.php
index 70a34e3..c49c3eb 100644 (file)
@@ -760,7 +760,7 @@ class SpecialUndelete extends SpecialPage {
 
                if ( $this->mTimestamp !== '' ) {
                        $this->showRevision( $this->mTimestamp );
-               } elseif ( $this->mFilename !== null ) {
+               } elseif ( $this->mFilename !== null && $this->mTargetObj->inNamespace( NS_FILE ) ) {
                        $file = new ArchivedFile( $this->mTargetObj, '', $this->mFilename );
                        // Check if user is allowed to see this file
                        if ( !$file->exists() ) {
@@ -1115,10 +1115,11 @@ class SpecialUndelete extends SpecialPage {
                $out->addHTML(
                        Xml::openElement( 'form', array(
                                        'method' => 'POST',
-                                       'action' => $this->getTitle()->getLocalURL(
-                                               'target=' . urlencode( $this->mTarget ) .
-                                                       '&file=' . urlencode( $key ) .
-                                                       '&token=' . urlencode( $user->getEditToken( $key ) ) )
+                                       'action' => $this->getTitle()->getLocalURL( array(
+                                               'target' => $this->mTarget,
+                                               'file' => $key,
+                                               'token' => $user->getEditToken( $key ),
+                                       ) ),
                                )
                        ) .
                                Xml::submitButton( $this->msg( 'undelete-show-file-submit' )->text() ) .