diff --git a/web/includes/Object.php b/web/includes/Object.php index 5023587fd..44f25f805 100644 --- a/web/includes/Object.php +++ b/web/includes/Object.php @@ -13,15 +13,15 @@ class ZM_Object { $row = NULL; if ($IdOrRow) { - if (is_integer($IdOrRow) or ctype_digit($IdOrRow)) { + if (is_array($IdOrRow)) { + $row = $IdOrRow; + } else if (is_integer($IdOrRow)) { $table = $class::$table; - $row = dbFetchOne("SELECT * FROM `$table` WHERE `Id`=?", NULL, array($IdOrRow)); + $row = dbFetchOne('SELECT * FROM `$table` WHERE `Id`=?', NULL, array($IdOrRow)); if (!$row) { Error("Unable to load $class record for Id=$IdOrRow"); return; } - } else if (is_array($IdOrRow)) { - $row = $IdOrRow; } if ( $row ) {