r14824 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14823‎ | r14824 | r14825 >
Date:03:24, 20 June 2006
Author:brion
Status:old
Tags:
Comment:
Fix regression in paging
Modified paths:
  • /trunk/extensions/LinkSearch/LinkSearch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LinkSearch/LinkSearch.php
@@ -51,7 +51,7 @@
5252 $page = $dbr->tableName( 'page' );
5353 $externallinks = $dbr->tableName( 'externallinks' );
5454
55 - $encSearch = $dbr->addQuotes( $this->mQuery );
 55+ $encSearch = $dbr->addQuotes( self::mungeQuery( $this->mQuery ) );
5656
5757 return
5858 "SELECT
@@ -76,6 +76,21 @@
7777
7878 return wfMsgHtml( 'linksearch-line', $urlLink, $pageLink );
7979 }
 80+
 81+ /**
 82+ * Override to check query validity.
 83+ */
 84+ function doQuery( $offset, $limit ) {
 85+ global $wgOut;
 86+ $this->mMungedQuery = LinkSearchPage::mungeQuery( $this->mQuery );
 87+ if( $this->mMungedQuery === false ) {
 88+ $wgOut->addWikiText( wfMsg( 'linksearch-error' ) );
 89+ } else {
 90+ // For debugging
 91+ $wgOut->addHtml( "\n<!-- " . htmlspecialchars( $this->mMungedQuery ) . " -->\n" );
 92+ parent::doQuery( $offset, $limit );
 93+ }
 94+ }
8095
8196 }
8297
@@ -96,16 +111,8 @@
97112 wfCloseElement( 'form' ) );
98113
99114 if( $target != '' ) {
100 - // For debugging
101 - $search = LinkSearchPage::mungeQuery( $target );
102 - if( $search === false ) {
103 - $wgOut->addWikiText( wfMsg( 'linksearch-error' ) );
104 - } else {
105 - $wgOut->addHtml( "\n<!-- " . htmlspecialchars( $search ) . " -->\n" );
106 -
107 - $searcher = new LinkSearchPage( $search );
108 - $searcher->doQuery( $offset, $limit );
109 - }
 115+ $searcher = new LinkSearchPage( $target );
 116+ $searcher->doQuery( $offset, $limit );
110117 }
111118 }
112119 }

Status & tagging log