From f547396124a4a57338e1a0d8e7f69cf8ddf3dc6a Mon Sep 17 00:00:00 2001 From: zYne Date: Fri, 25 Aug 2006 17:17:55 +0000 Subject: [PATCH] Little fix for cleanData method --- Doctrine/Record.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Doctrine/Record.php b/Doctrine/Record.php index 33ef42f67..cf1296da1 100644 --- a/Doctrine/Record.php +++ b/Doctrine/Record.php @@ -270,12 +270,14 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite case "object": if($tmp[$name] !== self::$null) { - if( ! is_array($tmp[$name] && ! is_object($tmp[$name])) + if(is_string($tmp[$name])) { $value = unserialize($tmp[$name]); - - if($value === false) - throw new Doctrine_Exception("Unserialization of $name failed. ".var_dump($tmp[$name],true)); + if($value === false) + throw new Doctrine_Exception("Unserialization of $name failed. ".var_dump($tmp[$name],true)); + } else + $value = $tmp[$name]; + $this->data[$name] = $value; } break;