$profile = new ProfileSection( __METHOD__ );
$search = $this->getSearchEngine();
- // Request an extra result to determine whether a "next page" link is useful
- $search->setLimitOffset( $this->limit + 1, $this->offset );
+ $search->setLimitOffset( $this->limit, $this->offset );
$search->setNamespaces( $this->namespaces );
$this->saveNamespaces();
$search->prefix = $this->mPrefix;
$this->offset,
$this->limit,
$this->powerSearchOptions() + array( 'search' => $term ),
- max( $titleMatchesNum, $textMatchesNum ) <= $this->limit
+ $this->limit + $this->offset >= $totalRes
);
}
wfRunHooks( 'SpecialSearchResults', array( $term, &$titleMatches, &$textMatches ) );
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.
$out = "<ul class='mw-search-results'>\n";
$result = $matches->next();
- $count = 0;
- while ( $result && $count < $this->limit ) {
+ while ( $result ) {
$out .= $this->showHit( $result, $terms );
$result = $matches->next();
- $count++;
}
$out .= "</ul>\n";
$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',