$rewritten = $search->replacePrefixes( $term );
$titleMatches = $search->searchTitle( $rewritten );
- if ( !( $titleMatches instanceof SearchResultTooMany ) ) {
- $textMatches = $search->searchText( $rewritten );
- }
+ $textMatches = $search->searchText( $rewritten );
$textStatus = null;
if ( $textMatches instanceof Status ) {
Xml::closeElement( 'div' )
);
- // Sometimes the search engine knows there are too many hits
- if ( $titleMatches instanceof SearchResultTooMany ) {
- $out->wrapWikiMsg( "==$1==\n", 'toomanymatches' );
-
- return;
- }
-
$filePrefix = $wgContLang->getFormattedNsText( NS_FILE ) . ':';
if ( trim( $term ) === '' || $filePrefix === trim( $term ) ) {
$out->addHTML( $this->formHeader( $term, 0, 0 ) );
if ( $num === 0 ) {
if ( $textStatus ) {
$out->addHTML( '<div class="error">' .
- htmlspecialchars( $textStatus->getWikiText( 'search-error' ) ) . '</div>' );
+ $textStatus->getMessage( 'search-error' ) . '</div>' );
} else {
$out->wrapWikiMsg( "<p class=\"mw-search-nonefound\">\n$1</p>",
array( 'search-nonefound', wfEscapeWikiText( $term ) ) );
if ( $user->isLoggedIn() &&
!is_null( $request->getVal( 'nsRemember' ) ) &&
- $user->matchEditToken( $request->getVal( 'nsToken' ) )
+ $user->matchEditToken(
+ $request->getVal( 'nsToken' ),
+ 'searchnamespace',
+ $request
+ )
) {
// Reset namespace preferences: namespaces are not searched
// when they're not mentioned in the URL parameters.
foreach ( MWNamespace::getValidNamespaces() as $n ) {
- if ( $n >= 0 ) {
- $user->setOption( 'searchNs' . $n, false );
- }
+ $user->setOption( 'searchNs' . $n, false );
}
// The request parameters include all the namespaces we just searched.
// Even if they're the same as an existing profile, they're not eaten.
$remember = '';
$user = $this->getUser();
if ( $user->isLoggedIn() ) {
- $remember .= Html::hidden( 'nsToken', $user->getEditToken() ) .
+ $remember .= Html::hidden(
+ 'nsToken',
+ $user->getEditToken(
+ 'searchnamespace',
+ $this->getRequest()
+ )
+ ) .
Xml::checkLabel(
wfMessage( 'powersearch-remember' )->text(),
'nsRemember',