]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blobdiff - includes/specials/SpecialWithoutinterwiki.php
MediaWiki 1.16.0
[autoinstalls/mediawiki.git] / includes / specials / SpecialWithoutinterwiki.php
index 2092e43b52490e7319a7aec0101b450f704c146b..a5d60d2f2e899381942f5010f42d2483dfd1bcd1 100644 (file)
@@ -53,7 +53,7 @@ class WithoutInterwikiPage extends PageQueryPage {
        function getSQL() {
                $dbr = wfGetDB( DB_SLAVE );
                list( $page, $langlinks ) = $dbr->tableNamesN( 'page', 'langlinks' );
-               $prefix = $this->prefix ? "AND page_title LIKE '" . $dbr->escapeLike( $this->prefix ) . "%'" : '';
+               $prefix = $this->prefix ? 'AND page_title' . $dbr->buildLike( $this->prefix , $dbr->anyString() ) : '';
                return
                  "SELECT 'Withoutinterwiki'  AS type,
                          page_namespace AS namespace,
@@ -75,13 +75,10 @@ class WithoutInterwikiPage extends PageQueryPage {
 }
 
 function wfSpecialWithoutinterwiki() {
-       global $wgRequest, $wgContLang, $wgCapitalLinks;
+       global $wgRequest, $wgContLang;
        list( $limit, $offset ) = wfCheckLimits();
-       if( $wgCapitalLinks ) {
-               $prefix = $wgContLang->ucfirst( $wgRequest->getVal( 'prefix' ) );
-       } else {
-               $prefix = $wgRequest->getVal( 'prefix' );
-       }
+       // Only searching the mainspace anyway
+       $prefix = Title::capitalize( $wgRequest->getVal( 'prefix' ), NS_MAIN );
        $wip = new WithoutInterwikiPage();
        $wip->setPrefix( $prefix );
        $wip->doQuery( $offset, $limit );