From 8f2b8bf478b4ef577c51d884cdf5ebcc41cf09d3 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 1 Jun 2022 10:40:31 -0400 Subject: [PATCH] Test for is_array first, get rid of ctype_digit test as passing a null to it is deprecated --- web/includes/Object.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 ) {