Clean up search results if scrolled of the end
authorNik Everett <neverett@wikimedia.org>
Tue, 29 Jul 2014 16:54:40 +0000 (12:54 -0400)
committerNik Everett <neverett@wikimedia.org>
Tue, 29 Jul 2014 16:54:40 +0000 (12:54 -0400)
If the user ends up off the end of the search results then show them a
slightly more sane page:  no more showing results 50 - 20 of 20.

Bug: 68783
Change-Id: I29354e15873054278be18d74b2355b83b86f35f3

includes/specials/SpecialSearch.php

index 1df674a..248a15a 100644 (file)
@@ -1091,7 +1091,7 @@ class SpecialSearch extends SpecialPage {
                ) . "\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 ) )