diff options
author | Alessandro Dolci <alessandro.rn@gmail.com> | 2018-10-31 03:05:33 +0300 |
---|---|---|
committer | MaurĂcio Meneghini Fauth <mauriciofauth@gmail.com> | 2018-10-31 03:05:33 +0300 |
commit | 3f5fff3f4d474fd9dd67f54ff2366d2a466e0c07 (patch) | |
tree | b61263964c34893d2d7ab086cd8870faae68d42a /libraries | |
parent | 108e6d0c49a596f4ae5d918dd7bc211a7bb9fe03 (diff) |
Fixed condition on the emptiness of enum type criteriaValues array (#14648)
The if condition has a call to the empty function on the criteriaValues array, but in the considered case that array only contains a '0', so this makes it look empty to the function. I added a control on the first element of the array, to avoid this specific situation.
It's my first contribution, so I hope I did well with the branches. Let me know if there's something missing or to do, I'm happy to help.
Signed-off-by: Alessandro Dolci <alessandro.dolci@pm.me>
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/classes/Controllers/Table/TableSearchController.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libraries/classes/Controllers/Table/TableSearchController.php b/libraries/classes/Controllers/Table/TableSearchController.php index ac896961bf..64bb527682 100644 --- a/libraries/classes/Controllers/Table/TableSearchController.php +++ b/libraries/classes/Controllers/Table/TableSearchController.php @@ -1152,7 +1152,7 @@ class TableSearchController extends TableController $where = ''; if ($unaryFlag) { $where = $backquoted_name . ' ' . $func_type; - } elseif (strncasecmp($types, 'enum', 4) == 0 && ! empty($criteriaValues)) { + } elseif (strncasecmp($types, 'enum', 4) == 0 && (! empty($criteriaValues) || $criteriaValues[0] === '0')) { $where = $backquoted_name; $where .= $this->_getEnumWhereClause($criteriaValues, $func_type); } elseif ($criteriaValues != '') { |