Fixed handling null values in Sqlserver->value

The value function quoted a null value as N'' instead of NULL.
As a result is produced queries like [name] IS N'' instead of [name] IS NULL which resulted in an SQL error.
This commit is contained in:
ovidiupruteanu 2013-09-09 16:33:54 +03:00
parent 86bee4de09
commit b58940e9b5

View file

@ -571,7 +571,7 @@ class Sqlserver extends DboSource {
* @return string Quoted and escaped data
*/
public function value($data, $column = null) {
if (is_array($data) || is_object($data)) {
if ($data === null || is_array($data) || is_object($data)) {
return parent::value($data, $column);
} elseif (in_array($data, array('{$__cakeID__$}', '{$__cakeForeignKey__$}'), true)) {
return $data;