mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-27 16:58:31 -04:00
Test for is_array first, get rid of ctype_digit test as passing a null to it is deprecated
This commit is contained in:
1 parent
b47d036b89
commit
8f2b8bf478
1 file changed
+4
-4
@@ -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 ) {
|
||||
|
||||
Reference in new issue
Block a user