changing wfQuery to allow replication
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 20 Sep 2003 02:21:40 +0000 (02:21 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 20 Sep 2003 02:21:40 +0000 (02:21 +0000)
13 files changed:
includes/SpecialLongpages.php
includes/SpecialMaintenance.php
includes/SpecialMovepage.php
includes/SpecialNewpages.php
includes/SpecialPopularpages.php
includes/SpecialRandompage.php
includes/SpecialRecentchanges.php
includes/SpecialRecentchangeslinked.php
includes/SpecialShortpages.php
includes/SpecialStatistics.php
includes/SpecialUndelete.php
includes/SpecialUnusedimages.php
includes/SpecialWantedpages.php

index e199613..2203f5a 100644 (file)
@@ -21,7 +21,7 @@ function wfSpecialLongpages()
        $sql = "SELECT cur_title, LENGTH(cur_text) AS len FROM cur " .
          "WHERE cur_namespace=0 AND cur_is_redirect=0 ORDER BY " .
          "LENGTH(cur_text) DESC LIMIT {$offset}, {$limit}";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $sk = $wgUser->getSkin();
 
index 0e3f180..37b5875 100644 (file)
@@ -109,7 +109,7 @@ function wfSpecialDisambiguations()
                . " AND d.cur_namespace=0"
                . " LIMIT {$offset}, {$limit}";
 
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $sk = $wgUser->getSkin();
 
@@ -145,7 +145,7 @@ function wfSpecialDoubleRedirects()
 
        $sql = "SELECT l_from,l_to,cb.cur_text AS rt,cb.cur_title AS ti FROM links,cur AS ca, cur AS cb WHERE ca.cur_is_redirect=1 AND cb.cur_is_redirect=1 AND l_to=cb.cur_id AND l_from=ca.cur_title AND ca.cur_namespace=0 LIMIT {$offset}, {$limit}" ;
 
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $top = getMaintenancePageBacklink();
        $top .= "<p>".wfMsg("doubleredirectstext")."</p><br>\n";
@@ -181,7 +181,7 @@ function wfSpecialBrokenRedirects()
 
        $sql = "SELECT bl_to,cur_title FROM brokenlinks,cur WHERE cur_is_redirect=1 AND cur_namespace=0 AND bl_from=cur_id LIMIT {$offset}, {$limit}" ;
 
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $top = getMaintenancePageBacklink();
        $top .= "<p>".wfMsg("brokenredirectstext")."</p><br>\n";
@@ -215,7 +215,7 @@ function wfSpecialSelfLinks()
 
        $sql = "SELECT cur_title FROM cur,links WHERE cur_is_redirect=0 AND cur_namespace=0 AND l_from=cur_title AND l_to=cur_id LIMIT {$offset}, {$limit}";
 
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $top = getMaintenancePageBacklink();
        $top .= "<p>".wfMsg("selflinkstext")."</p><br>\n";
@@ -252,7 +252,7 @@ function wfSpecialMispeelings ()
 
         # Load list from database
         $sql = "SELECT cur_text FROM cur WHERE cur_title='{$mss}' AND cur_namespace=4" ;
-        $res = wfQuery( $sql, $fname );
+        $res = wfQuery( $sql, DB_READ, $fname );
         $obj = wfFetchObject ( $res ) ;
         $l = $obj->cur_text ;
         $l = explode ( "\n" , $l ) ;
@@ -270,7 +270,7 @@ function wfSpecialMispeelings ()
                         $x = preg_replace( '/^(\S+).*$/', '$1', $x );
                        #$sql = "SELECT DISTINCT cur_title FROM cur WHERE cur_namespace=0 AND cur_is_redirect=0 AND (MATCH(cur_ind_text) AGAINST ('" . wfStrencode( $wgLang->stripForSearch( $x ) ) . "'))" ;
                        $sql = "SELECT DISTINCT cur_title FROM cur,searchindex WHERE cur_id=si_page AND cur_namespace=0 AND cur_is_redirect=0 AND (MATCH(si_text) AGAINST ('" . wfStrencode( $wgLang->stripForSearch( $x ) ) . "'))" ;
-                        $res = wfQuery( $sql, $fname );
+                        $res = wfQuery( $sql, DB_READ, $fname );
                         while ( $obj = wfFetchObject ( $res ) ) {
                                 if ( $cnt >= $offset AND $cnt < $offset+$limit ) {
                                         if ( $y != "" ) {
@@ -315,7 +315,7 @@ function wfSpecialMissingLanguageLinks()
 
        $sql = "SELECT cur_title FROM cur WHERE cur_namespace=0 AND cur_is_redirect=0 AND cur_title NOT LIKE '%/%' AND cur_text NOT LIKE '%[[{$thelang}:%' LIMIT {$offset}, {$limit}";
 
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
 
        $mll = wfMsg("missinglanguagelinkstext");
index eb8fbc2..3b77ac3 100644 (file)
@@ -236,7 +236,7 @@ class MovePageForm {
 
                $sql = "SELECT cur_is_redirect,cur_text FROM cur " .
                  "WHERE cur_id={$this->newid}";
-               $res = wfQuery( $sql, $fname );
+               $res = wfQuery( $sql, DB_READ, $fname );
                $obj = wfFetchObject( $res );
 
                if ( 0 == $obj->cur_is_redirect ) { return false; }
@@ -250,7 +250,7 @@ class MovePageForm {
                }
                $sql = "SELECT old_id FROM old WHERE old_namespace={$this->nns} " .
                  "AND old_title='{$this->ndt}'";
-               $res = wfQuery( $sql, $fname );
+               $res = wfQuery( $sql, DB_READ, $fname );
                if ( 0 != wfNumRows( $res ) ) { return false; }
 
                return true;
@@ -269,7 +269,7 @@ class MovePageForm {
                $sql = "UPDATE cur SET cur_touched='{$now}'," .
                  "cur_namespace={$this->nns},cur_title='{$this->ndt}' " .
                  "WHERE cur_id={$this->oldid}";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                $sql = "UPDATE cur SET cur_touched='{$now}'," .
                  "cur_namespace={$this->ons},cur_title='{$this->odt}'," .
@@ -278,17 +278,17 @@ class MovePageForm {
                  "',cur_minor_edit=0,cur_counter=0,cur_restrictions=''," .
                  "cur_user_text='" . wfStrencode( $wgUser->getName() ) . "'," .
                  "cur_is_redirect=1,cur_is_new=0 WHERE cur_id={$this->newid}";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                $sql = "UPDATE old SET " .
                  "old_namespace={$this->nns},old_title='{$this->ndt}' WHERE " .
                  "old_namespace={$this->ons} AND old_title='{$this->odt}'";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
                
                $sql = "UPDATE recentchanges SET ".
                        "rc_namespace={$this->nns}, rc_title='{$this->ndt}' WHERE ".
                        "rc_cur_id={$this->oldid}";
-        wfQuery( $sql, $fname );
+        wfQuery( $sql, DB_WRITE, $fname );
 
                $sql = "INSERT INTO recentchanges (rc_namespace,rc_title,
                        rc_comment,rc_user,rc_user_text,rc_timestamp,
@@ -297,35 +297,35 @@ class MovePageForm {
                  "'{$mt} \\\"{$this->nft}\\\"','" .
                  $wgUser->getID() . "','" . wfStrencode( $wgUser->getName() ) .
           "','{$now}','{$now}',{$this->newid},1)";
-        wfQuery( $sql, $fname );
+        wfQuery( $sql, DB_WRITE, $fname );
 
                # The only link from here should be the old redirect
 
                $sql = "DELETE FROM links WHERE l_from='{$this->nft}'";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                $sql = "UPDATE links SET l_from='{$this->nft}' WHERE l_from='{$this->oft}'";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                # Swap links.  Using MAXINT as a temp; if there's ever an article
                # with id 4294967295, this will fail, but I think that's pretty safe
 
                $sql = "UPDATE links SET l_to=4294967295 WHERE l_to={$this->oldid}";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                $sql = "UPDATE links SET l_to={$this->oldid} WHERE l_to={$this->newid}";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                $sql = "UPDATE links SET l_to={$this->newid} WHERE l_to=4294967295";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                # Note: the insert below must be after the updates above!
 
                $sql = "INSERT INTO links (l_from,l_to) VALUES ('{$this->oft}',{$this->oldid})";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                $sql = "UPDATE imagelinks SET il_from='{$this->nft}' WHERE il_from='{$this->oft}'";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
        }
 
        # Move page to non-existing title.
@@ -341,7 +341,7 @@ class MovePageForm {
                $sql = "UPDATE cur SET cur_touched='{$now}'," .
                  "cur_namespace={$this->nns},cur_title='{$this->ndt}' " .
                  "WHERE cur_id={$this->oldid}";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                $common = "{$this->ons},'{$this->odt}'," .
                  "'{$mt} \\\"{$this->nft}\\\"','" .
@@ -351,33 +351,33 @@ class MovePageForm {
                  "cur_comment,cur_user,cur_user_text,cur_timestamp,inverse_timestamp," .
                  "cur_touched,cur_text,cur_is_redirect,cur_is_new) " .
                  "VALUES ({$common},'{$won}','{$now}','#REDIRECT [[{$this->nft}]]\n',1,1)";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
                $this->newid = wfInsertId();
 
                $sql = "UPDATE old SET " .
                  "old_namespace={$this->nns},old_title='{$this->ndt}' WHERE " .
                  "old_namespace={$this->ons} AND old_title='{$this->odt}'";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
         $sql = "UPDATE recentchanges SET ".
                        "rc_namespace={$this->nns}, rc_title='{$this->ndt}' WHERE ".
                        "rc_namespace={$this->ons} AND rc_title='{$this->odt}'";
-        wfQuery( $sql, $fname );
+        wfQuery( $sql, DB_WRITE, $fname );
 
                $sql = "INSERT INTO recentchanges (rc_namespace,rc_title,
                        rc_comment,rc_user,rc_user_text,rc_timestamp,
                        rc_cur_time,rc_cur_id,rc_new)
                        VALUES ({$common},'{$now}',{$this->newid},1)";
-        wfQuery( $sql, $fname );
+        wfQuery( $sql, DB_WRITE, $fname );
 
                $sql = "UPDATE links SET l_from='{$this->nft}' WHERE l_from='{$this->oft}'";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                $sql = "UPDATE links SET l_to={$this->newid} WHERE l_to={$this->oldid}";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                $sql = "INSERT INTO links (l_from,l_to) VALUES ('{$this->oft}',{$this->oldid})";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                # Non-existent target may have had broken links to it; these must
                # now be removed and made into good links.
@@ -385,7 +385,7 @@ class MovePageForm {
                $update->fixBrokenLinks();
 
                $sql = "UPDATE imagelinks SET il_from='{$this->nft}' WHERE il_from='{$this->oft}'";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
        }
 
        function updateWatchlists()
@@ -400,14 +400,14 @@ class MovePageForm {
 
                $sql = "SELECT wl_user FROM watchlist
                        WHERE wl_namespace={$oldnamespace} AND wl_title='{$oldtitle}'";
-               $res = wfQuery( $sql, $fname );
+               $res = wfQuery( $sql, DB_READ, $fname );
                if( $s = wfFetchObject( $res ) ) {
                        $sql = "REPLACE INTO watchlist (wl_user,wl_namespace,wl_title)
                                VALUES ({$s->wl_user},{$newnamespace},'{$newtitle}')";
                        while( $s = wfFetchObject( $res ) ) {
                                $sql .= ",({$s->wl_user},{$newnamespace},'{$newtitle}')";
                        }
-                       wfQuery( $sql, $fname );
+                       wfQuery( $sql, DB_WRITE, $fname );
                }
        }
 
index ff3ece9..3d0dc43 100644 (file)
@@ -11,7 +11,7 @@ function wfSpecialNewpages()
          "rc_timestamp AS cur_timestamp,length(cur_text) as cur_length FROM recentchanges,cur " .
          "WHERE rc_cur_id=cur_id AND rc_new=1 AND rc_namespace=0 AND cur_is_redirect=0 " .
          "ORDER BY rc_timestamp DESC LIMIT {$offset}, {$limit}";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $top = wfShowingResults( $offset, $limit );
        $wgOut->addHTML( "<p>{$top}\n" );
index 628a528..303a909 100644 (file)
@@ -16,7 +16,7 @@ function wfSpecialPopularpages()
        $sql = "SELECT DISTINCT cur_title, cur_counter FROM cur " .
          "WHERE cur_namespace=0 AND cur_is_redirect=0 ORDER BY " .
          "cur_counter DESC LIMIT {$offset}, {$limit}";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $sk = $wgUser->getSkin();
 
index 9eadd04..00b3ac0 100644 (file)
@@ -15,7 +15,7 @@ function wfSpecialRandompage()
                AND cur_random>$randstr
                ORDER BY cur_random
                LIMIT 1";
-       $res = wfQuery( $sqlget, $fname );
+       $res = wfQuery( $sqlget, DB_READ, $fname );
        if( $s = wfFetchObject( $res ) ) {
                $rt = wfUrlEncode( $s->cur_title );
        } else {
index 70ea460..c0fa2ca 100644 (file)
@@ -15,7 +15,7 @@ function wfSpecialRecentchanges( $par )
        }
        
        $sql = "SELECT MAX(rc_timestamp) AS lastmod FROM recentchanges";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
        $s = wfFetchObject( $res );
        $wgOut->checkLastModified( $s->lastmod );
 
@@ -23,7 +23,7 @@ function wfSpecialRecentchanges( $par )
        
        # The next few lines can probably be commented out now that wfMsg can get text from the DB
        $sql = "SELECT cur_text FROM cur WHERE cur_namespace=4 AND cur_title='Recentchanges'";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
        if( ( $s = wfFetchObject( $res ) ) and ( $s->cur_text != "" ) ) {
                $rctext = $s->cur_text;
        }
@@ -72,7 +72,7 @@ function wfSpecialRecentchanges( $par )
          ($uid ? "LEFT OUTER JOIN watchlist ON wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace & 65534 " : "") .
          "WHERE rc_timestamp > '{$cutoff}' {$hidem} " .
          "ORDER BY rc_timestamp DESC LIMIT {$limit}";
-       $res = wfQuery( $sql2, $fname );
+       $res = wfQuery( $sql2, DB_READ, $fname );
 
        if(isset($from)) {
                $note = wfMsg( "rcnotefrom", $limit,
index cb5f69e..6dd6952 100644 (file)
@@ -51,7 +51,7 @@ function wfSpecialRecentchangeslinked( $par = NULL )
          "WHERE cur_timestamp > '{$cutoff}' {$cmq} AND l_to=cur_id AND l_from='" .
       wfStrencode( $nt->getPrefixedDBkey() ) . "' GROUP BY cur_id " .
          "ORDER BY inverse_timestamp LIMIT {$limit}";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $note = wfMsg( "rcnote", $limit, $days );
        $wgOut->addHTML( "<hr>\n{$note}\n<br>" );
index ffdd65f..deb3824 100644 (file)
@@ -21,7 +21,7 @@ function wfSpecialShortpages()
        $sql = "SELECT cur_title, LENGTH(cur_text) AS len FROM cur " .
          "WHERE cur_namespace=0 AND cur_is_redirect=0 ORDER BY " .
          "LENGTH(cur_text) LIMIT {$offset}, {$limit}";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $top = wfShowingResults( $offset, $limit );
        $wgOut->addHTML( "<p>{$top}\n" );
index 8c4335f..35c4f21 100644 (file)
@@ -8,13 +8,13 @@ function wfSpecialStatistics()
        $wgOut->addHTML( "<h2>" . wfMsg( "sitestats" ) . "</h2>\n" );
 
        $sql = "SELECT COUNT(cur_id) AS total FROM cur";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
        $row = wfFetchObject( $res );
        $total = $row->total;
 
        $sql = "SELECT ss_total_views, ss_total_edits, ss_good_articles " .
          "FROM site_stats WHERE ss_row_id=1";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
        $row = wfFetchObject( $res );
        $views = $row->ss_total_views;
        $edits = $row->ss_total_edits;
@@ -31,13 +31,13 @@ function wfSpecialStatistics()
        $wgOut->addHTML( "<h2>" . wfMsg( "userstats" ) . "</h2>\n" );
 
        $sql = "SELECT COUNT(user_id) AS total FROM user";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
        $row = wfFetchObject( $res );
        $total = $row->total;
 
        $sql = "SELECT COUNT(user_id) AS total FROM user " .
          "WHERE user_rights LIKE '%sysop%'";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
        $row = wfFetchObject( $res );
        $admins = $row->total;
 
index 0c19aae..116ec67 100644 (file)
@@ -20,7 +20,7 @@ function wfSpecialUndelete( $par )
     
     # List undeletable articles    
     $sql = "SELECT ar_namespace,ar_title, COUNT(*) AS count FROM archive GROUP BY ar_namespace,ar_title ORDER BY ar_title";
-    $res = wfQuery( $sql );
+    $res = wfQuery( $sql, DB_READ );
     
        $wgOut->setPagetitle( wfMsg( "undeletepage" ) );
        $wgOut->addWikiText( wfMsg( "undeletepagetext" ) );
@@ -49,7 +49,7 @@ function wfSpecialUndelete( $par )
     if(!preg_match("/[0-9]{14}/",$timestamp)) return 0;
     
     $sql = "SELECT ar_text FROM archive WHERE ar_namespace={$namespace} AND ar_title=\"{$title}\" AND ar_timestamp={$timestamp}";
-    $ret = wfQuery( $sql );
+    $ret = wfQuery( $sql, DB_READ );
     $row = wfFetchObject( $ret );
     
     $wgOut->setPagetitle( wfMsg( "undeletepage" ) );
@@ -84,7 +84,7 @@ function wfSpecialUndelete( $par )
     $sql = "SELECT ar_minor_edit,ar_timestamp,ar_user,ar_user_text,ar_comment
       FROM archive WHERE ar_namespace={$namespace} AND ar_title=\"{$title}\"
       ORDER BY ar_timestamp DESC";
-    $ret = wfQuery( $sql );
+    $ret = wfQuery( $sql, DB_READ );
     
     $special = $wgLang->getNsText( Namespace::getSpecial() );
     $wgOut->addHTML("<ul>");
@@ -116,7 +116,7 @@ function wfSpecialUndelete( $par )
 
                # Move article and history from the "archive" table
                $sql = "SELECT COUNT(*) AS count FROM cur WHERE cur_namespace={$namespace} AND cur_title='{$t}'";
-               $res = wfQuery( $sql );
+               $res = wfQuery( $sql, DB_READ );
                $row = wfFetchObject( $res );
                if( $row->count == 0) {
                        # Have to create new article...
@@ -127,7 +127,7 @@ function wfSpecialUndelete( $par )
                          "SELECT ar_namespace,ar_title,ar_text,ar_comment," .
                          "ar_user,ar_user_text,ar_timestamp,99999999999999-ar_timestamp,ar_minor_edit,RAND(),'{$now}' FROM archive " .
                          "WHERE ar_namespace={$namespace} AND ar_title='{$t}' AND ar_timestamp={$max}";
-                       wfQuery( $sql, $fname );
+                       wfQuery( $sql, DB_WRITE, $fname );
                $newid = wfInsertId();
                        $oldones = "AND ar_timestamp<{$max}";
                } else {
@@ -141,7 +141,7 @@ function wfSpecialUndelete( $par )
                  "old_flags) SELECT ar_namespace,ar_title,ar_text,ar_comment," .
                  "ar_user,ar_user_text,ar_timestamp,99999999999999-ar_timestamp,ar_minor_edit,ar_flags " .
                  "FROM archive WHERE ar_namespace={$namespace} AND ar_title='{$t}' {$oldones}";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
         # Finally, clean up the link tables 
                if( $newid ) {
@@ -151,7 +151,7 @@ function wfSpecialUndelete( $par )
                        $dummyOut = new OutputPage();
                        $to = Title::newFromDBKey( $target );
                        $res = wfQuery( "SELECT cur_text FROM cur WHERE cur_id={$newid} " .
-                         "AND cur_namespace={$namespace}", $fname );
+                         "AND cur_namespace={$namespace}", DB_READ, $fname );
                        $row = wfFetchObject( $res );
                        $text = $row->cur_text;
                        $dummyOut->addWikiText( $text );
@@ -166,7 +166,7 @@ function wfSpecialUndelete( $par )
                # Now that it's safely stored, take it out of the archive
                $sql = "DELETE FROM archive WHERE ar_namespace={$namespace} AND " .
                  "ar_title='{$t}'";
-               wfQuery( $sql, $fname );
+               wfQuery( $sql, DB_WRITE, $fname );
 
                
         # Touch the log?
index 284394c..a594be0 100644 (file)
@@ -11,7 +11,7 @@ function wfSpecialUnusedimages()
        $sql = "SELECT img_name,img_user,img_user_text,img_timestamp,img_description " .
          "FROM image LEFT JOIN imagelinks ON img_name=il_to WHERE il_to IS NULL " .
          "ORDER BY img_timestamp LIMIT {$offset}, {$limit}";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $sk = $wgUser->getSkin();
 
index 3dab5de..af8aac4 100644 (file)
@@ -26,7 +26,7 @@ function wfSpecialWantedpages()
        $sql = "SELECT bl_to, COUNT( DISTINCT bl_from ) as nlinks " .
          "FROM brokenlinks GROUP BY bl_to HAVING nlinks > 1 " .
          "ORDER BY nlinks DESC LIMIT {$offset}, {$limit}";
-       $res = wfQuery( $sql, $fname );
+       $res = wfQuery( $sql, DB_READ, $fname );
 
        $sk = $wgUser->getSkin();