Remove form when including empty Special:WhatLinksHere
authorumherirrender <umherirrender_de.wp@web.de>
Wed, 14 Jan 2015 18:09:55 +0000 (19:09 +0100)
committerUmherirrender <umherirrender_de.wp@web.de>
Fri, 3 Apr 2015 06:28:52 +0000 (06:28 +0000)
Included special pages should never show a form, because a included
special page is designed to show the result of something, not allow
starting a search (where than Special:WhatLinksHere is opened instead of
showing the result within the wiki page).

On no input Special:WhatLinksHere would output nothing, like a
transcluded Special:Contributions would do.

Bug: T67779
Change-Id: I289fd8fe6bbd4238581035770a472b1c7b9f2643

includes/specials/SpecialWhatlinkshere.php

index 40cce5e..0b3175a 100644 (file)
@@ -73,7 +73,9 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
 
                $this->target = Title::newFromURL( $opts->getValue( 'target' ) );
                if ( !$this->target ) {
-                       $out->addHTML( $this->whatlinkshereForm() );
+                       if ( !$this->including() ) {
+                               $out->addHTML( $this->whatlinkshereForm() );
+                       }
 
                        return;
                }