SpecialUndelete: Don't try to add a form to the page unless it exists
authorJames D. Forrester <jforrester@wikimedia.org>
Mon, 24 Jul 2017 21:09:33 +0000 (14:09 -0700)
committerBartosz Dziewoński <matma.rex@gmail.com>
Tue, 25 Jul 2017 21:35:59 +0000 (21:35 +0000)
Bug: T171523
Change-Id: I1083ce168797a698c76c3fdff4eac06edfb0ac6a

includes/specials/SpecialUndelete.php

index 810f8fb..39904b0 100644 (file)
@@ -858,11 +858,12 @@ class SpecialUndelete extends SpecialPage {
                        $misc = Html::hidden( 'target', $this->mTarget );
                        $misc .= Html::hidden( 'wpEditToken', $this->getUser()->getEditToken() );
                        $history .= $misc;
-               }
-
-               $form->appendContent( new OOUI\HtmlSnippet( $history ) );
 
-               $out->addHTML( $form );
+                       $form->appendContent( new OOUI\HtmlSnippet( $history ) );
+                       $out->addHTML( $form );
+               } else {
+                       $out->addHTML( $history );
+               }
 
                return true;
        }