diff options
author | Dries Buytaert <dries@buytaert.net> | 2011-05-11 21:49:20 -0400 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2011-05-11 21:49:20 -0400 |
commit | 7770f08228f02d380bfb8daa483975bc5b8987fc (patch) | |
tree | 1ea650500b6ea9d08d33bf8afa17ca24f241230b /includes/database/sqlite/query.inc | |
parent | fa18bb3a0d43e4335faf4baecd8a28d2aeceec5e (diff) | |
download | drupal-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.inc | 8 |
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) . '} '; } |