Skip to content
Permalink
Browse files

Fixing value quoting in DboMysql

  • Loading branch information...
lorenzo committed Oct 15, 2010
1 parent 0fb2ac0 commit bd856c7ef9d17014c178602177f455984ae07658
Showing with 3 additions and 3 deletions.
  1. +3 −3 cake/libs/model/datasources/dbo/dbo_mysql.php
@@ -656,10 +656,10 @@ function value($data, $column = null, $safe = false) {
return $parent;
}
if ($data === null || (is_array($data) && empty($data))) {
return 'NULL';
return $this->_connection->quote($data, PDO::PARAM_NULL);
}
if ($data === '' && $column !== 'integer' && $column !== 'float' && $column !== 'boolean') {
return "''";
return $this->_connection->quote($data, PDO::PARAM_STR);
}
if (empty($column)) {
$column = $this->introspectType($data);
@@ -684,7 +684,7 @@ function value($data, $column = null, $safe = false) {
return $data;
}
default:
return "'" . mysql_real_escape_string($data, $this->connection) . "'";
return $this->_connection->quote($data, PDO::PARAM_STR);
break;
}
}

0 comments on commit bd856c7

Please sign in to comment.
You can’t perform that action at this time.