From 7057b4e6098bee9c086a3261c40b4b1d2079c7a2 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 20 Sep 2003 01:34:06 +0000 Subject: [PATCH] wfQuery now takes three parameters -- one extra for DB replication purposes --- includes/ImagePage.php | 14 +++++----- includes/LinkCache.php | 6 ++--- includes/LinksUpdate.php | 44 +++++++++++++++---------------- includes/LogPage.php | 8 +++--- includes/Math.php | 4 +-- includes/OutputPage.php | 2 +- includes/SearchEngine.php | 6 ++--- includes/SearchUpdate.php | 4 +-- includes/SiteStatsUpdate.php | 2 +- includes/Skin.php | 7 ++--- includes/SpecialAllpages.php | 10 +++---- includes/SpecialAncientpages.php | 2 +- includes/SpecialAsksql.php | 2 +- includes/SpecialBooksources.php | 2 +- includes/SpecialCategories.php | 4 +-- includes/SpecialContributions.php | 8 +++--- includes/SpecialImagelist.php | 2 +- includes/SpecialListusers.php | 2 +- 18 files changed, 65 insertions(+), 64 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index e86efa1418..300883fb9f 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -30,7 +30,7 @@ class ImagePage extends Article { $sql = "SELECT img_size,img_description,img_user," . "img_user_text,img_timestamp FROM image WHERE " . "img_name='" . wfStrencode( $this->mTitle->getDBkey() ) . "'"; - $res = wfQuery( $sql, $fname ); + $res = wfQuery( $sql, DB_READ, $fname ); if ( 0 == wfNumRows( $res ) ) { return; } @@ -46,7 +46,7 @@ class ImagePage extends Article { "oi_user_text,oi_timestamp,oi_archive_name FROM oldimage WHERE " . "oi_name='" . wfStrencode( $this->mTitle->getDBkey() ) . "' " . "ORDER BY oi_timestamp DESC"; - $res = wfQuery( $sql, $fname ); + $res = wfQuery( $sql, DB_READ, $fname ); while ( $line = wfFetchObject( $res ) ) { $s .= $sk->imageHistoryLine( false, $line->oi_timestamp, @@ -65,7 +65,7 @@ class ImagePage extends Article { $sql = "SELECT il_from FROM imagelinks WHERE il_to='" . wfStrencode( $this->mTitle->getDBkey() ) . "'"; - $res = wfQuery( $sql, "Article::imageLinks" ); + $res = wfQuery( $sql, DB_READ, "Article::imageLinks" ); if ( 0 == wfNumRows( $res ) ) { $wgOut->addHtml( "

" . wfMsg( "nolinkstoimage" ) . "\n" ); @@ -137,18 +137,18 @@ class ImagePage extends Article { } $sql = "DELETE FROM image WHERE img_name='" . wfStrencode( $image ) . "'"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); $sql = "SELECT oi_archive_name FROM oldimage WHERE oi_name='" . wfStrencode( $image ) . "'"; - $res = wfQuery( $sql, $fname ); + $res = wfQuery( $sql, DB_READ, $fname ); while ( $s = wfFetchObject( $res ) ) { $this->doDeleteOldImage( $s->oi_archive_name ); } $sql = "DELETE FROM oldimage WHERE oi_name='" . wfStrencode( $image ) . "'"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); # Image itself is now gone, and database is cleaned. # Now we remove the image description page. @@ -161,7 +161,7 @@ class ImagePage extends Article { $this->doDeleteOldImage( $oldimage ); $sql = "DELETE FROM oldimage WHERE oi_archive_name='" . wfStrencode( $oldimage ) . "'"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); $deleted = $oldimage; } else { diff --git a/includes/LinkCache.php b/includes/LinkCache.php index fdac7368e8..379da89f4a 100644 --- a/includes/LinkCache.php +++ b/includes/LinkCache.php @@ -91,7 +91,7 @@ class LinkCache { if( $id === FALSE ) { $sql = "SELECT HIGH_PRIORITY cur_id FROM cur WHERE cur_namespace=" . "{$ns} AND cur_title='" . wfStrencode( $t ) . "'"; - $res = wfQuery( $sql, "LinkCache::addLink" ); + $res = wfQuery( $sql, DB_READ, "LinkCache::addLink" ); if ( 0 == wfNumRows( $res ) ) { $id = 0; @@ -115,7 +115,7 @@ class LinkCache { $sql = "SELECT HIGH_PRIORITY cur_id,cur_namespace,cur_title FROM cur,links WHERE cur_id=l_to AND l_from='{$dbkeyfrom}'"; - $res = wfQuery( $sql, "LinkCache::preFill" ); + $res = wfQuery( $sql, DB_READ, "LinkCache::preFill" ); while( $s = wfFetchObject( $res ) ) { $this->addGoodLink( $s->cur_id, Title::makeName( $s->cur_namespace, $s->cur_title ) @@ -129,7 +129,7 @@ class LinkCache { $sql = "SELECT HIGH_PRIORITY bl_to FROM brokenlinks WHERE bl_from='{$id}'"; - $res = wfQuery( $sql, "LinkCache::preFill" ); + $res = wfQuery( $sql, DB_READ, "LinkCache::preFill" ); while( $s = wfFetchObject( $res ) ) { $this->addBadLink( $s->bl_to ); } diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index 2b30abbb07..de4b86182e 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -32,7 +32,7 @@ class LinksUpdate { if( $wgDBtransactions ) { $sql = "BEGIN"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); } #------------------------------------------------------------------------------ @@ -43,12 +43,12 @@ class LinksUpdate { if ( count( $del ) ) { $sql = "DELETE FROM links WHERE l_from='{$this->mTitleEnc}' AND l_to IN(". implode( ",", $del ) . ")"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); } } else { # Delete everything $sql = "DELETE FROM links WHERE l_from='{$this->mTitleEnc}'"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); # Get the addition list $add = $wgLinkCache->getGoodLinks(); @@ -68,7 +68,7 @@ class LinksUpdate { } } if ( "" != $sql ) { - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); } #------------------------------------------------------------------------------ @@ -79,12 +79,12 @@ class LinksUpdate { if ( count( $del ) ) { $sql = "DELETE FROM brokenlinks WHERE bl_from={$this->mId} AND bl_to IN('" . implode( "','", $del ) . "')"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); } } else { # Delete all $sql = "DELETE FROM brokenlinks WHERE bl_from={$this->mId}"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); # Get addition list $add = $wgLinkCache->getBadLinks(); @@ -104,13 +104,13 @@ class LinksUpdate { } } if ( "" != $sql ) { - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); } #------------------------------------------------------------------------------ # Image links $sql = "DELETE FROM imagelinks WHERE il_from='{$this->mTitleEnc}'"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); # Get addition list $add = $wgLinkCache->getImageLinks(); @@ -128,13 +128,13 @@ class LinksUpdate { $sql .= "('{$this->mTitleEnc}','{$iname}')"; } } - if ( "" != $sql ) { wfQuery( $sql, $fname ); } + if ( "" != $sql ) { wfQuery( $sql, DB_WRITE, $fname ); } $this->fixBrokenLinks(); if( $wgDBtransactions ) { $sql = "COMMIT"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); } wfProfileOut(); } @@ -149,11 +149,11 @@ class LinksUpdate { if( $wgDBtransactions ) { $sql = "BEGIN"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); } $sql = "DELETE FROM links WHERE l_from='{$this->mTitleEnc}'"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); $a = $wgLinkCache->getGoodLinks(); $sql = ""; @@ -167,10 +167,10 @@ class LinksUpdate { $sql .= "('{$this->mTitleEnc}',{$lid})"; } } - if ( "" != $sql ) { wfQuery( $sql, $fname ); } + if ( "" != $sql ) { wfQuery( $sql, DB_WRITE, $fname ); } $sql = "DELETE FROM brokenlinks WHERE bl_from={$this->mId}"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); $a = $wgLinkCache->getBadLinks(); $sql = ""; @@ -185,10 +185,10 @@ class LinksUpdate { $sql .= "({$this->mId},'{$blt}')"; } } - if ( "" != $sql ) { wfQuery( $sql, $fname ); } + if ( "" != $sql ) { wfQuery( $sql, DB_WRITE, $fname ); } $sql = "DELETE FROM imagelinks WHERE il_from='{$this->mTitleEnc}'"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); $a = $wgLinkCache->getImageLinks(); $sql = ""; @@ -203,13 +203,13 @@ class LinksUpdate { $sql .= "('{$this->mTitleEnc}','{$iname}')"; } } - if ( "" != $sql ) { wfQuery( $sql, $fname ); } + if ( "" != $sql ) { wfQuery( $sql, DB_WRITE, $fname ); } $this->fixBrokenLinks(); if( $wgDBtransactions ) { $sql = "COMMIT"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); } wfProfileOut(); } @@ -219,7 +219,7 @@ class LinksUpdate { /* Call for a newly created page, or just to make sure state is consistent */ $sql = "SELECT bl_from FROM brokenlinks WHERE bl_to='{$this->mTitleEnc}'"; - $res = wfQuery( $sql, $fname ); + $res = wfQuery( $sql, DB_READ, $fname ); if ( 0 == wfNumRows( $res ) ) { return; } $sql = "INSERT INTO links (l_from,l_to) VALUES "; @@ -235,11 +235,11 @@ class LinksUpdate { $sql2 .= $row->bl_from; } $sql2 .= ")"; - wfQuery( $sql, $fname ); - wfQuery( $sql2, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); + wfQuery( $sql2, DB_WRITE, $fname ); $sql = "DELETE FROM brokenlinks WHERE bl_to='{$this->mTitleEnc}'"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); } } diff --git a/includes/LogPage.php b/includes/LogPage.php index 08ad054ee5..a2d5e92fc2 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -21,7 +21,7 @@ class LogPage { $sql = "SELECT cur_id,cur_text,cur_timestamp FROM cur " . "WHERE cur_namespace=" . Namespace::getWikipedia() . " AND " . "cur_title='" . wfStrencode($this->mTitle ) . "'"; - $res = wfQuery( $sql, "LogPage::getContent" ); + $res = wfQuery( $sql, DB_READ, "LogPage::getContent" ); if( wfNumRows( $res ) > 0 ) { $s = wfFetchObject( $res ); @@ -67,7 +67,7 @@ class LogPage { wfStrencode( $this->mTitle ) . "', '" . wfStrencode( $this->mContent ) . "', '" . wfStrencode( $this->mComment ) . "', 'sysop', '{$won}','{$now}')"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); $this->mId = wfInsertId(); } else { $sql = "UPDATE cur SET cur_timestamp='{$now}', " . @@ -76,7 +76,7 @@ class LogPage { "cur_comment='" . wfStrencode( $this->mComment ) . "', " . "cur_restrictions='sysop', inverse_timestamp='{$won}', cur_touched='{$now}' " . "WHERE cur_id={$this->mId}"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); } # And update recentchanges @@ -86,7 +86,7 @@ class LogPage { rc_cur_id) VALUES ('{$now}','{$now}',{$uid},'{$ut}',4,'" . wfStrencode( $this->mTitle ) . "','" . wfStrencode( $this->mComment ) . "',{$this->mId})"; - wfQuery( $sql, $fname ); + wfQuery( $sql, DB_WRITE, $fname ); } return true; } diff --git a/includes/Math.php b/includes/Math.php index 60fe6a8d3b..3479a990e9 100644 --- a/includes/Math.php +++ b/includes/Math.php @@ -25,7 +25,7 @@ function renderMath( $tex ) else $sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM math WHERE math_inputhash = '".$md5_sql."'"; - $res = wfQuery( $sql, $fname ); + $res = wfQuery( $sql, DB_READ, $fname ); if ( wfNumRows( $res ) == 0 ) { $cmd = "./math/texvc ".escapeshellarg($wgTmpDirectory)." ". @@ -94,7 +94,7 @@ function renderMath( $tex ) $sql = "REPLACE INTO math VALUES ('".$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html.", ".$sql_mathml.")"; - $res = wfQuery( $sql, $fname ); + $res = wfQuery( $sql, DB_WRITE, $fname ); # we don't really care if it fails if (($math == 0) || ($rpage->math_html == '') || (($math == 1) && ($conservativeness != 2)) || (($math == 4) && ($conservativeness == 0))) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 2fd15de496..3919d214dc 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -561,7 +561,7 @@ class OutputPage { global $wgUser ; $sk = $wgUser->getSkin() ; $sql = "SELECT l_from FROM links WHERE l_to={$id}" ; - $res = wfQuery ( $sql ) ; + $res = wfQuery ( $sql, DB_READ ) ; while ( $x = wfFetchObject ( $res ) ) { # $t = new Title ; diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index 210286eded..314cf3fac5 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -175,7 +175,7 @@ class SearchEngine { "WHERE cur_id=si_page AND {$this->mTitlecond} " . "{$searchnamespaces} {$redircond}" . "LIMIT {$offset}, {$limit}"; - $res1 = wfQuery( $sql, $fname ); + $res1 = wfQuery( $sql, DB_READ, $fname ); $num = wfNumRows($res1); if ( $wgDisableTextSearch ) { @@ -186,7 +186,7 @@ class SearchEngine { "WHERE cur_id=si_page AND {$this->mTextcond} " . "{$searchnamespaces} {$redircond} " . "LIMIT {$offset}, {$limit}"; - $res2 = wfQuery( $sql, $fname ); + $res2 = wfQuery( $sql, DB_READ, $fname ); $num = $num + wfNumRows($res2); } @@ -422,7 +422,7 @@ class SearchEngine { "WHERE cur_id=si_page AND {$this->mTitlecond} ORDER BY cur_namespace LIMIT 1"; if ( "" != $this->mTitlecond ) { - $res = wfQuery( $sql, $fname ); + $res = wfQuery( $sql, DB_READ, $fname ); } if ( isset( $res ) && 0 != wfNumRows( $res ) ) { $s = wfFetchObject( $res ); diff --git a/includes/SearchUpdate.php b/includes/SearchUpdate.php index 9e9ff2af1f..f77ba41a73 100644 --- a/includes/SearchUpdate.php +++ b/includes/SearchUpdate.php @@ -28,7 +28,7 @@ class SearchUpdate { $sql = "UPDATE LOW_PRIORITY searchindex SET si_title='" . wfStrencode( Title::indexTitle( $this->mNamespace, $this->mTitle ) ) . "' WHERE si_page={$this->mId}"; - wfQuery( $sql, "SearchUpdate::doUpdate" ); + wfQuery( $sql, DB_WRITE, "SearchUpdate::doUpdate" ); return; } @@ -71,7 +71,7 @@ class SearchUpdate { $sql = "REPLACE DELAYED INTO searchindex (si_page,si_title,si_text) VALUES ({$this->mId},'" . wfStrencode( Title::indexTitle( $this->mNamespace, $this->mTitle ) ) . "','" . wfStrencode( $text ) . "')"; - wfQuery( $sql, "SearchUpdate::doUpdate" ); + wfQuery( $sql, DB_WRITE, "SearchUpdate::doUpdate" ); } } diff --git a/includes/SiteStatsUpdate.php b/includes/SiteStatsUpdate.php index 61ca8464c3..f8ab804b79 100644 --- a/includes/SiteStatsUpdate.php +++ b/includes/SiteStatsUpdate.php @@ -33,7 +33,7 @@ class SiteStatsUpdate { $sql = "UPDATE LOW_PRIORITY site_stats SET " . implode ( ",", $a ) . " WHERE ss_row_id=1"; - wfQuery( $sql, "SiteStatsUpdate::doUpdate" ); + wfQuery( $sql, DB_WRITE, "SiteStatsUpdate::doUpdate" ); } } diff --git a/includes/Skin.php b/includes/Skin.php index dc6886cced..2ea643d7ca 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -6,7 +6,7 @@ # Language class has internationalized names # /* private */ $wgValidSkinNames = array( - "Standard", "Nostalgia", "CologneBlue", "Smarty", "Montparnasse" + "Standard", "Nostalgia", "CologneBlue" #, "Smarty", "Montparnasse" ); # For some odd PHP bug, this function can't be part of a class @@ -1140,7 +1140,7 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval ) } else { $threshold = $wgUser->getOption("stubthreshold") ; if ( $threshold > 0 ) { - $res = wfQuery ( "SELECT HIGH_PRIORITY length(cur_text) AS x, cur_namespace, cur_is_redirect FROM cur WHERE cur_id='{$aid}'" ) ; + $res = wfQuery ( "SELECT HIGH_PRIORITY length(cur_text) AS x, cur_namespace, cur_is_redirect FROM cur WHERE cur_id='{$aid}'", DB_READ ) ; if ( wfNumRows( $res ) > 0 ) { $s = wfFetchObject( $res ); @@ -1812,6 +1812,7 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval ) include_once( "SkinStandard.php" ); include_once( "SkinNostalgia.php" ); include_once( "SkinCologneBlue.php" ); -include_once( "SkinSmarty.php" ); + +#include_once( "SkinSmarty.php" ); ?> diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php index 8ba82258f4..2e01937f25 100644 --- a/includes/SpecialAllpages.php +++ b/includes/SpecialAllpages.php @@ -37,13 +37,13 @@ function indexShowToplevel() $out = ""; $sql = "SELECT COUNT(*) AS count $fromwhere"; - $res = wfQuery( $sql, $fname ); + $res = wfQuery( $sql, DB_READ, $fname ); $s = wfFetchObject( $res ); $count = $s->count; $sections = ceil( $count / $indexMaxperpage ); $sql = "SELECT cur_title $fromwhere $order LIMIT 1"; - $res = wfQuery( $sql, $fname ); + $res = wfQuery( $sql, DB_READ, $fname ); $s = wfFetchObject( $res ); $inpoint = $s->cur_title; @@ -52,7 +52,7 @@ function indexShowToplevel() for( $i = 1; $i < $sections; $i++ ) { $from = $i * $indexMaxperpage; $sql = "SELECT cur_title $fromwhere $order LIMIT $from,2"; - $res = wfQuery( $sql, $fname ); + $res = wfQuery( $sql, DB_READ, $fname ); $s = wfFetchObject( $res ); $outpoint = $s->cur_title; @@ -66,7 +66,7 @@ function indexShowToplevel() $from = $i * $indexMaxperpage; $sql = "SELECT cur_title $fromwhere $order LIMIT " . ($count-1) . ",1"; - $res = wfQuery( $sql, $fname ); + $res = wfQuery( $sql, DB_READ, $fname ); $s = wfFetchObject( $res ); $outpoint = $s->cur_title; $out .= indexShowline( $inpoint, $outpoint ); @@ -106,7 +106,7 @@ FROM cur WHERE cur_namespace=0 AND cur_title >= '" . wfStrencode( $from ) . "' ORDER BY cur_title LIMIT {$indexMaxperpage}"; - $res = wfQuery( $sql, "indexShowChunk" ); + $res = wfQuery( $sql, DB_READ, "indexShowChunk" ); # FIXME: Dynamic column widths, backlink to main list, # side links to next and previous diff --git a/includes/SpecialAncientpages.php b/includes/SpecialAncientpages.php index 95f8334ab4..60c736a54d 100644 --- a/includes/SpecialAncientpages.php +++ b/includes/SpecialAncientpages.php @@ -11,7 +11,7 @@ function wfSpecialAncientpages() "cur_timestamp FROM cur USE INDEX (cur_timestamp) " . "WHERE cur_namespace=0 AND cur_is_redirect=0 " . " ORDER BY cur_timestamp LIMIT {$offset}, {$limit}"; - $res = wfQuery( $sql, $fname ); + $res = wfQuery( $sql, DB_READ, $fname ); $top = wfShowingResults( $offset, $limit ); $wgOut->addHTML( "

{$top}\n" ); diff --git a/includes/SpecialAsksql.php b/includes/SpecialAsksql.php index 062e1c1a28..5466dad792 100644 --- a/includes/SpecialAsksql.php +++ b/includes/SpecialAsksql.php @@ -72,7 +72,7 @@ class SqlQueryForm { $connection = wfGetDB( $wgDBsqluser, $wgDBsqlpassword ); } $this->logQuery( $wpSqlQuery ); - $res = wfQuery( $wpSqlQuery, "SpecialAsksql::doSubmit" ); + $res = wfQuery( $wpSqlQuery, DB_READ, "SpecialAsksql::doSubmit" ); $this->logFinishedQuery(); $n = 0; diff --git a/includes/SpecialBooksources.php b/includes/SpecialBooksources.php index b1ae00f545..c7630f5e22 100644 --- a/includes/SpecialBooksources.php +++ b/includes/SpecialBooksources.php @@ -34,7 +34,7 @@ class BookSourceList { $sql = "SELECT cur_text FROM cur " . "WHERE cur_namespace=4 and cur_title='" . wfStrencode( $bstitle->getDBkey() ) . "'"; - $res = wfQuery( $sql, $fname ); + $res = wfQuery( $sql, DB_READ, $fname ); if( ( $s = wfFetchObject( $res ) ) and ( $s->cur_text != "" ) ) { $bstext = $s->cur_text; $bstext = str_replace( "MAGICNUMBER", $this->mIsbn, $bstext ); diff --git a/includes/SpecialCategories.php b/includes/SpecialCategories.php index 831cc9bda8..c23dc0892b 100644 --- a/includes/SpecialCategories.php +++ b/includes/SpecialCategories.php @@ -10,7 +10,7 @@ function wfSpecialCategories() $r .= "

    \n" ; $cat = ucfirst ( wfMsg ( "category" ) ) ; $sql = "SELECT cur_title FROM cur WHERE cur_title LIKE \"{$cat}:%\"" ; - $res = wfQuery ( $sql ) ; + $res = wfQuery ( $sql, DB_READ ) ; while ( $x = wfFetchObject ( $res ) ) { $t = explode ( ":" , $x->cur_title , 2 ) ; @@ -24,7 +24,7 @@ function wfSpecialCategories() $r .= "
    \n" ; $sql = "SELECT DISTINCT bl_to FROM brokenlinks WHERE bl_to LIKE \"{$cat}:%\"" ; - $res = wfQuery ( $sql ) ; + $res = wfQuery ( $sql, DB_READ ) ; $r .= "
      \n" ; while ( $x = wfFetchObject ( $res ) ) { diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index fc88af8c96..d25a0ac037 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -49,20 +49,20 @@ function wfSpecialContributions( $par = "" ) $sql = "SELECT cur_namespace,cur_title,cur_timestamp,cur_comment FROM cur " . "WHERE cur_user_text='" . wfStrencode( $nt->getText() ) . "' {$cmq} " . "ORDER BY inverse_timestamp LIMIT {$offset}, {$limit}"; - $res1 = wfQuery( $sql, $fname ); + $res1 = wfQuery( $sql, DB_READ, $fname ); $sql = "SELECT old_namespace,old_title,old_timestamp,old_comment FROM old " . "WHERE old_user_text='" . wfStrencode( $nt->getText() ) . "' {$omq} " . "ORDER BY inverse_timestamp LIMIT {$offset}, {$limit}"; - $res2 = wfQuery( $sql, $fname ); + $res2 = wfQuery( $sql, DB_READ, $fname ); } else { $sql = "SELECT cur_namespace,cur_title,cur_timestamp,cur_comment FROM cur " . "WHERE cur_user={$id} {$cmq} ORDER BY inverse_timestamp LIMIT {$offset}, {$limit}"; - $res1 = wfQuery( $sql, $fname ); + $res1 = wfQuery( $sql, DB_READ, $fname ); $sql = "SELECT old_namespace,old_title,old_timestamp,old_comment FROM old " . "WHERE old_user={$id} {$omq} ORDER BY inverse_timestamp LIMIT {$offset}, {$limit}"; - $res2 = wfQuery( $sql, $fname ); + $res2 = wfQuery( $sql, DB_READ, $fname ); } $nCur = wfNumRows( $res1 ); $nOld = wfNumRows( $res2 ); diff --git a/includes/SpecialImagelist.php b/includes/SpecialImagelist.php index 4c02240cb0..2b0a49fd38 100644 --- a/includes/SpecialImagelist.php +++ b/includes/SpecialImagelist.php @@ -85,7 +85,7 @@ function wfSpecialImagelist() $text = str_replace( "$2", $bydate, $text ); $wgOut->addHTML( "{$text}
      \n

      " ); - $res = wfQuery( $sql, "wfSpecialImagelist" ); + $res = wfQuery( $sql, DB_READ, "wfSpecialImagelist" ); while ( $s = wfFetchObject( $res ) ) { $name = $s->img_name; $ut = $s->img_user_text; diff --git a/includes/SpecialListusers.php b/includes/SpecialListusers.php index 7fb1bf0d12..629776fa42 100644 --- a/includes/SpecialListusers.php +++ b/includes/SpecialListusers.php @@ -15,7 +15,7 @@ function wfSpecialListusers() $sql = "SELECT user_name,user_rights FROM user ORDER BY " . "user_name LIMIT {$offset}, {$limit}"; - $res = wfQuery( $sql, "wfSpecialListusers" ); + $res = wfQuery( $sql, DB_READ, "wfSpecialListusers" ); $sk = $wgUser->getSkin(); while ( $s = wfFetchObject( $res ) ) { -- 2.20.1