From 380fdf2e40e3bfd9e5781b44afa48499c0345045 Mon Sep 17 00:00:00 2001 From: Roliga Date: Thu, 4 Apr 2019 22:55:46 +0200 Subject: [PATCH] [ParameterValidator] Handle missing parameter type (#1057) * [ParameterValidator] Handle missing parameter type --- lib/ParameterValidator.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/ParameterValidator.php b/lib/ParameterValidator.php index 11fd3adf..55e6fe4b 100644 --- a/lib/ParameterValidator.php +++ b/lib/ParameterValidator.php @@ -195,16 +195,14 @@ class ParameterValidator { foreach($set as $id => $properties) { if(isset($data[$id]) && !empty($data[$id])) { $queriedContexts[$context] = true; - } elseif(isset($properties['required']) - && $properties['required'] === true - && isset($properties['type']) - && $properties['type'] !== 'checkbox' - && $properties['type'] !== 'list') { + } elseif (isset($properties['type']) + && ($properties['type'] === 'checkbox' || $properties['type'] === 'list')) { + continue; + } elseif(isset($properties['required']) && $properties['required'] === true) { $queriedContexts[$context] = false; break; } } - } // Abort if one of the globally required parameters is not satisfied