Misc/Util

* relax numeric type requirements when working with filters
 * restore smart type casting functionality of Util::checkNumeric when used with NUM_ANY
 * enable Util::arraySumByKey to work recursively
 * fix source display in listview
This commit is contained in:
Sarjuuk
2024-06-16 17:05:23 +02:00
parent a4d05dc036
commit cb3c7d4ef0
6 changed files with 30 additions and 20 deletions

View File

@@ -393,7 +393,7 @@ class CreatureListFilter extends Filter
if (!$this->parentCats || $this->parentCats[0] != 1)
return false;
if (!Util::checkNumeric($val, NUM_REQ_INT))
if (!Util::checkNumeric($val, NUM_CAST_INT))
return false;
$type = FILTER_V_LIST;
@@ -518,7 +518,7 @@ class CreatureListFilter extends Filter
protected function cbFaction($cr)
{
if (!Util::checkNumeric($cr[1], NUM_REQ_INT))
if (!Util::checkNumeric($cr[1], NUM_CAST_INT))
return false;
if (!in_array($cr[1], $this->enums[$cr[0]]))