mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
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:
parent
86bee4de09
commit
b58940e9b5
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue