Skip to content

Commit

Permalink
fixes #6277, relaxing character length comparison for UUID
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8149 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information
gwoo committed Apr 22, 2009
1 parent 6e91ee7 commit 0cc3d51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cake/libs/model/model.php
Expand Up @@ -1210,7 +1210,7 @@ function save($data = null, $validate = true, $fieldList = array()) {
foreach ($this->_schema as $field => $properties) {
if ($this->primaryKey === $field) {
$fInfo = $this->_schema[$field];
$isUUID = ($fInfo['length'] === 36 &&
$isUUID = ($fInfo['length'] == 36 &&
($fInfo['type'] === 'string' || $fInfo['type'] === 'binary')
);
if (empty($this->data[$this->alias][$this->primaryKey]) && $isUUID) {
Expand Down Expand Up @@ -1279,7 +1279,7 @@ function __saveMulti($joined, $id) {
));

$isUUID = !empty($this->{$join}->primaryKey) && (
$this->{$join}->_schema[$this->{$join}->primaryKey]['length'] === 36 && (
$this->{$join}->_schema[$this->{$join}->primaryKey]['length'] == 36 && (
$this->{$join}->_schema[$this->{$join}->primaryKey]['type'] === 'string' ||
$this->{$join}->_schema[$this->{$join}->primaryKey]['type'] === 'binary'
)
Expand Down

0 comments on commit 0cc3d51

Please sign in to comment.