r24973 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24972‎ | r24973 | r24974 >
Date:11:36, 21 August 2007
Author:mkroetzsch
Status:old
Tags:
Comment:
Fixed missing db escape
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php
@@ -1247,8 +1247,8 @@
12481248
12491249 $pagetable = $db->tableName('page');
12501250 $cltable = $db->tableName('categorylinks');
1251 - $db->query("INSERT INTO $tablename (title) VALUES ('$catname')", 'SMW::getCategoryTable');
1252 - $db->query("INSERT INTO $tmpnew (title) VALUES ('$catname')", 'SMW::getCategoryTable');
 1251+ $db->query("INSERT INTO $tablename (title) VALUES (" . $db->addQuotes($catname) . ')', 'SMW::getCategoryTable');
 1252+ $db->query("INSERT INTO $tmpnew (title) VALUES (" . $db->addQuotes($catname) . ')', 'SMW::getCategoryTable');
12531253
12541254 /// TODO: avoid duplicate results?
12551255 for ($i=0; $i<$smwgQSubcategoryDepth; $i++) {
@@ -1308,8 +1308,8 @@
13091309 $tmpres = 'smw_res';
13101310
13111311 $sptable = $db->tableName('smw_subprops');
1312 - $db->query("INSERT INTO $tablename (title) VALUES ('$propname')", 'SMW::getPropertyTable');
1313 - $db->query("INSERT INTO $tmpnew (title) VALUES ('$propname')", 'SMW::getPropertyTable');
 1312+ $db->query("INSERT INTO $tablename (title) VALUES (" . $db->addQuotes($propname) . ')', 'SMW::getPropertyTable');
 1313+ $db->query("INSERT INTO $tmpnew (title) VALUES (" . $db->addQuotes($propname) . ')', 'SMW::getPropertyTable');
13141314
13151315 /// TODO: avoid duplicate results?
13161316 for ($i=0; $i<$smwgQSubpropertyDepth; $i++) {

Status & tagging log