From 7593988a7ce2965aeb0aae604bc4d7ef7392c9a8 Mon Sep 17 00:00:00 2001 From: sel-1 <32393371+sel-1@users.noreply.github.com> Date: Thu, 17 Apr 2025 17:14:45 +0200 Subject: [PATCH] Update gump.class.php to fix type of field error as integer The change is needed because the validation of the if-s are based on integer values and not string. As $input['field']['error'] is passed as string, all the if are failing. --- gump.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gump.class.php b/gump.class.php index 3bc7333..c912b03 100644 --- a/gump.class.php +++ b/gump.class.php @@ -1812,6 +1812,10 @@ protected function validate_required_file($field, array $input, array $params = */ protected function validate_extension($field, $input, array $params, $value = null) { + if (isset($input[$field]['error']) && gettype($input[$field]['error']) == 'string') { + $input[$field]['error'] = (int) $input[$field]['error']; + } + if (!is_array($input[$field])) { return false; }