r26297 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r26296‎ | r26297 | r26298 >
Date:00:52, 2 October 2007
Author:erik
Status:old
Tags:
Comment:
more string escaping .. add $q_ prefix for escaped vars
Modified paths:
  • /branches/liquidthreads/extensions/LqtModel.php (modified) (history)

Diff [purge]

Index: branches/liquidthreads/extensions/LqtModel.php
@@ -947,8 +947,10 @@
948948 }
949949
950950 static function articleClause($article) {
 951+ $dbr = wfGetDB(DB_SLAVE);
 952+ $q_article= $dbr->addQuotes($article->getTitle()->getDBkey());
951953 return <<<SQL
952 -(thread.thread_article_title = "{$article->getTitle()->getDBkey()}"
 954+(thread.thread_article_title = $q_article
953955 AND thread.thread_article_namespace = {$article->getTitle()->getNamespace()})
954956 SQL;
955957 }
@@ -1036,14 +1038,14 @@
10371039 $talkpage_t = $t->article()->getTitle();
10381040 $root_t = $t->root()->getTitle();
10391041
1040 - $talkpage_t_s = $dbw->addQuotes($talkpage_t->getDBKey());
1041 - $root_t_s = $dbw->addQuotes($root_t->getDBKey());
 1042+ $q_talkpage_t = $dbw->addQuotes($talkpage_t->getDBKey());
 1043+ $q_root_t = $dbw->addQuotes($root_t->getDBKey());
10421044
10431045 // Select any applicable watchlist entries for the thread.
10441046 $where_clause = <<<SQL
10451047 (
1046 - (wl_namespace = {$talkpage_t->getNamespace()} and wl_title = $talkpage_t_s )
1047 -or (wl_namespace = {$root_t->getNamespace()} and wl_title = $root_t_s )
 1048+ (wl_namespace = {$talkpage_t->getNamespace()} and wl_title = $q_talkpage_t )
 1049+or (wl_namespace = {$root_t->getNamespace()} and wl_title = $q_root_t )
10481050 )
10491051 SQL;
10501052

Status & tagging log