Merge "Clean up search results if scrolled of the end"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 29 Jul 2014 20:34:10 +0000 (20:34 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 29 Jul 2014 20:34:10 +0000 (20:34 +0000)
1  2 
includes/specials/SpecialSearch.php

@@@ -424,10 -424,8 +424,10 @@@ class SpecialSearch extends SpecialPag
                        return;
                }
  
 +              $linkClass = 'mw-search-createlink';
                if ( $title->isKnown() ) {
                        $messageName = 'searchmenu-exists';
 +                      $linkClass = 'mw-search-exists';
                } elseif ( $title->quickUserCan( 'create', $this->getUser() ) ) {
                        $messageName = 'searchmenu-new';
                } else {
  
                // Extensions using the hook might still return an empty $messageName
                if ( $messageName ) {
 -                      $this->getOutput()->wrapWikiMsg( "<p class=\"mw-search-createlink\">\n$1</p>", $params );
 +                      $this->getOutput()->wrapWikiMsg( "<p class=\"$linkClass\">\n$1</p>", $params );
                } else {
                        // preserve the paragraph for margins etc...
                        $this->getOutput()->addHtml( '<p></p>' );
                ) . "\n";
  
                // Results-info
-               if ( $totalNum > 0 ) {
+               if ( $totalNum > 0 && $this->offset < $totalNum ) {
                        $top = $this->msg( 'showingresultsheader' )
                                ->numParams( $this->offset + 1, $this->offset + $resultsShown, $totalNum )
                                ->params( wfEscapeWikiText( $term ) )