summaryrefslogtreecommitdiffstatshomepage
path: root/includes/database/sqlite/query.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2011-05-11 21:49:20 -0400
committerDries Buytaert <dries@buytaert.net>2011-05-11 21:49:20 -0400
commit7770f08228f02d380bfb8daa483975bc5b8987fc (patch)
tree1ea650500b6ea9d08d33bf8afa17ca24f241230b /includes/database/sqlite/query.inc
parentfa18bb3a0d43e4335faf4baecd8a28d2aeceec5e (diff)
downloaddrupal-7770f08228f02d380bfb8daa483975bc5b8987fc.tar.gz
drupal-7770f08228f02d380bfb8daa483975bc5b8987fc.zip
- Patch #1105848 by cafuego, aspilicious: unsafe query comments possible via UI.
Diffstat (limited to 'includes/database/sqlite/query.inc')
-rw-r--r--includes/database/sqlite/query.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/database/sqlite/query.inc b/includes/database/sqlite/query.inc
index a176ed64937c..6b8a72f2ab46 100644
--- a/includes/database/sqlite/query.inc
+++ b/includes/database/sqlite/query.inc
@@ -32,8 +32,8 @@ class InsertQuery_sqlite extends InsertQuery {
}
public function __toString() {
- // Create a comments string to prepend to the query.
- $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+ // Create a sanitized comment string to prepend to the query.
+ $comments = $this->connection->makeComment($this->comments);
// Produce as many generic placeholders as necessary.
$placeholders = array_fill(0, count($this->insertFields), '?');
@@ -148,8 +148,8 @@ class DeleteQuery_sqlite extends DeleteQuery {
*/
class TruncateQuery_sqlite extends TruncateQuery {
public function __toString() {
- // Create a comments string to prepend to the query.
- $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+ // Create a sanitized comment string to prepend to the query.
+ $comments = $this->connection->makeComment($this->comments);
return $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '} ';
}