From b8104850a871e7036f67848ce23a5585ccac7e4b Mon Sep 17 00:00:00 2001 From: George Wilson Date: Fri, 22 Dec 2023 00:49:08 +0000 Subject: [PATCH] Fixes to form validation process Fixes hardening measure introduced in https://github.com/joomla/joomla-cms/pull/23716 --- libraries/src/Form/Form.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/src/Form/Form.php b/libraries/src/Form/Form.php index be7a800192deb..83f21a80b7098 100644 --- a/libraries/src/Form/Form.php +++ b/libraries/src/Form/Form.php @@ -182,9 +182,9 @@ protected function bindLevel($group, $data) } /** - * Return all errors, if any. + * Return Exceptions thrown during the form validation process. * - * @return \Exception[] Array of error messages or RuntimeException objects. + * @return \Exception[] * * @since 1.7.0 */ @@ -1134,6 +1134,7 @@ public function validate($data, $group = null) // The field returned false from setup and shouldn't be included in the page body - yet we received // a value for it. This is probably some sort of injection attack and should be rejected $this->errors[] = new \RuntimeException(Text::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', $key)); + $return = false; } }