$textMatches = $search->searchText( $rewritten );
}
+ $textStatus = null;
+ if( $textMatches instanceof Status ) {
+ $textStatus = $textMatches;
+ $textMatches = null;
+ }
+
// did you mean... suggestions
- if( $textMatches && $textMatches->hasSuggestion() ) {
+ if( $textMatches && !$textStatus && $textMatches->hasSuggestion() ) {
$st = SpecialPage::getTitleFor( 'Search' );
# mirror Go/Search behavior of original request ..
}
$titleMatches->free();
}
- if( $textMatches ) {
+ if( $textMatches && !$textStatus ) {
// output appropriate heading
if( $numTextMatches > 0 && $numTitleMatches > 0 ) {
// if no title matches the heading is redundant
$textMatches->free();
}
if( $num === 0 ) {
- $out->wrapWikiMsg( "<p class=\"mw-search-nonefound\">\n$1</p>", array( 'search-nonefound', wfEscapeWikiText( $term ) ) );
- $this->showCreateLink( $t );
+ if ( $textStatus ) {
+ $out->addHTML( '<div class="error">' .
+ htmlspecialchars( $textStatus->getWikiText( 'search-error' ) ) . '</div>' );
+ } else {
+ $out->wrapWikiMsg( "<p class=\"mw-search-nonefound\">\n$1</p>",
+ array( 'search-nonefound', wfEscapeWikiText( $term ) ) );
+ $this->showCreateLink( $t );
+ }
}
$out->addHtml( "</div>" );
# OpenSearch description
'opensearch-desc' => '{{SITENAME}} ({{CONTENTLANGUAGE}})', # do not translate or duplicate this message to other languages
+'search-error' => 'An error has occurred while searching: $1',
# Preferences page
'preferences' => 'Preferences',
In this sentence, "their indexes" refers to "Google\'s indexes".
Shown on [[Special:Search]] when the internal search is disabled.',
+'search-error' => 'Shown when an error has occurred when performing a search
+* $1 is the localized error that was returned',
# Preferences page
'preferences' => 'Title of the [[Special:Preferences]] page.