Merge "[search] Don't show the create link twice on results page"
[lhc/web/wiklou.git] / includes / specials / SpecialSearch.php
index e7a8677..9280b04 100644 (file)
@@ -417,7 +417,12 @@ class SpecialSearch extends SpecialPage {
                                $out->addHTML( '<div class="error">' .
                                        $textStatus->getMessage( 'search-error' ) . '</div>' );
                        } else {
-                               $this->showCreateLink( $title, $num, $titleMatches, $textMatches );
+                               if ( !$this->offset ) {
+                                       // If we have an offset the create link was rendered earlier in this function.
+                                       // This class needs a good de-spaghettification, but for now this will
+                                       // do the job.
+                                       $this->showCreateLink( $title, $num, $titleMatches, $textMatches );
+                               }
                                $out->wrapWikiMsg( "<p class=\"mw-search-nonefound\">\n$1</p>",
                                        [ $hasOtherResults ? 'search-nonefound-thiswiki' : 'search-nonefound',
                                                        wfEscapeWikiText( $term )