From 628bfc9963aa65c1447967e67949f21388ad569c Mon Sep 17 00:00:00 2001 From: GurvanKervern Date: Wed, 25 Aug 2021 18:15:32 +0800 Subject: [PATCH] Fix undef vars 4 To remove PHP8 warnings --- htdocs/ticket/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index c79a75e851c..b1922cf4aac 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -390,7 +390,7 @@ foreach ($search as $key => $val) { } continue; } - $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + $mode_search = ((!empty($object->fields[$key]) && $object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ($search[$key] != '') { $sql .= natural_search($key, $search[$key], $mode_search); } @@ -897,7 +897,7 @@ print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (!empty($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object