Skip to content

Commit

Permalink
Fixing issues with unicode quoting.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jun 23, 2011
1 parent 9ab2ec7 commit 3169c5a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Cake/Model/Datasource/Database/Sqlserver.php
Expand Up @@ -558,6 +558,8 @@ public function renderStatement($type, $data) {
public function value($data, $column = null) {
if (is_array($data) || is_object($data)) {
return parent::value($data, $column);
} elseif (in_array($data, array('{$__cakeID__$}', '{$__cakeForeignKey__$}'), true)) {
return $data;
}

if (empty($column)) {
Expand Down Expand Up @@ -658,8 +660,10 @@ public function buildColumn($column) {
} else {
$result = str_replace('DEFAULT NULL', 'NULL', $result);
}
} else if (array_keys($column) == array('type', 'name')) {
} elseif (array_keys($column) == array('type', 'name')) {
$result .= ' NULL';
} elseif (strpos($result, "DEFAULT N'")) {
$result = str_replace("DEFAULT N'", "DEFAULT '", $result);
}
return $result;
}
Expand Down

0 comments on commit 3169c5a

Please sign in to comment.