r56522 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56521‎ | r56522 | r56523 >
Date:15:19, 17 September 2009
Author:thomasv
Status:ok (Comments)
Tags:
Comment:
escaping messages passed to mysql
Modified paths:
  • /trunk/extensions/ProofreadPage/ProofreadPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/ProofreadPage.php
@@ -1293,7 +1293,7 @@
12941294 # find the proofreading status of transclusions
12951295 $query = "SELECT COUNT(page_id) AS count FROM $templatelinks LEFT JOIN $page ON page_title=tl_title LEFT JOIN $catlinks ON cl_from=page_id where tl_from=$id and tl_namespace=$page_ns_index AND cl_to='###'";
12961296
1297 - $q4 = str_replace( ' ' , '_' , wfMsgForContent( 'proofreadpage_quality4_category' ) );
 1297+ $q4 = $dbr->strencode( str_replace( ' ' , '_' , wfMsgForContent( 'proofreadpage_quality4_category' ) ) );
12981298 $res = $dbr->query( str_replace( '###', $q4, $query) , __METHOD__ );
12991299 if( $res && $dbr->numRows( $res ) > 0 ) {
13001300 $row = $dbr->fetchObject( $res );
@@ -1301,7 +1301,7 @@
13021302 $dbr->freeResult( $res );
13031303 }
13041304
1305 - $q3 = str_replace( ' ' , '_' , wfMsgForContent( 'proofreadpage_quality3_category' ) );
 1305+ $q3 = $dbr->strencode( str_replace( ' ' , '_' , wfMsgForContent( 'proofreadpage_quality3_category' ) ) );
13061306 $res = $dbr->query( str_replace( '###', $q3, $query) , __METHOD__ );
13071307 if( $res && $dbr->numRows( $res ) > 0 ) {
13081308 $row = $dbr->fetchObject( $res );
@@ -1309,7 +1309,7 @@
13101310 $dbr->freeResult( $res );
13111311 }
13121312
1313 - $q2 = str_replace( ' ' , '_' , wfMsgForContent( 'proofreadpage_quality2_category' ) );
 1313+ $q2 = $dbr->strencode( str_replace( ' ' , '_' , wfMsgForContent( 'proofreadpage_quality2_category' ) ) );
13141314 $res = $dbr->query( str_replace( '###', $q2, $query) , __METHOD__ );
13151315 if( $res && $dbr->numRows( $res ) > 0 ) {
13161316 $row = $dbr->fetchObject( $res );
@@ -1317,7 +1317,7 @@
13181318 $dbr->freeResult( $res );
13191319 }
13201320
1321 - $q0 = str_replace( ' ' , '_' , wfMsgForContent( 'proofreadpage_quality0_category' ) );
 1321+ $q0 = $dbr->strencode( str_replace( ' ' , '_' , wfMsgForContent( 'proofreadpage_quality0_category' ) ) );
13221322 $res = $dbr->query( str_replace( '###', $q0, $query) , __METHOD__ );
13231323 if( $res && $dbr->numRows( $res ) > 0 ) {
13241324 $row = $dbr->fetchObject( $res );

Comments

#Comment by Brion VIBBER (talk | contribs)   21:20, 17 September 2009

Good for now; needs a couple more fixes elsewhere still.

Status & tagging log