Commit 139febae authored by guilhermeblanco's avatar guilhermeblanco

Adjusted quoteIdentifier in update and delete when executing a SQL query (also fixes #807)

parent 9ee6158f
...@@ -584,7 +584,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun ...@@ -584,7 +584,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
{ {
$criteria = array(); $criteria = array();
foreach (array_keys($identifier) as $id) { foreach (array_keys($identifier) as $id) {
$criteria[] = $id . ' = ?'; $criteria[] = $this->quoteIdentifier($id) . ' = ?';
} }
$query = 'DELETE FROM ' $query = 'DELETE FROM '
...@@ -612,10 +612,10 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun ...@@ -612,10 +612,10 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
$set = array(); $set = array();
foreach ($data as $columnName => $value) { foreach ($data as $columnName => $value) {
if ($value instanceof Doctrine_Expression) { if ($value instanceof Doctrine_Expression) {
$set[] = $columnName . ' = ' . $value->getSql(); $set[] = $this->quoteIdentifier($columnName) . ' = ' . $value->getSql();
unset($data[$columnName]); unset($data[$columnName]);
} else { } else {
$set[] = $columnName . ' = ?'; $set[] = $this->quoteIdentifier($columnName) . ' = ?';
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment