From: Matthias Schmidt Date: Sun, 15 Apr 2018 14:25:23 +0000 (+0200) Subject: Abort field validation after first validation error X-Git-Tag: 5.2.0_Alpha_1~680^2~74 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a2a9ef847afee22b566f0e76d7790283ad58a318;p=GitHub%2FWoltLab%2FWCF.git Abort field validation after first validation error See #2509 --- diff --git a/wcfsetup/install/files/lib/system/form/builder/field/AbstractFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/AbstractFormField.class.php index b134dd8c51..9dcbb17fff 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/AbstractFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/AbstractFormField.class.php @@ -239,8 +239,14 @@ abstract class AbstractFormField implements IFormField { * @inheritDoc */ public function validate() { - foreach ($this->getValidators() as $validator) { - $validator($this); + if (empty($this->getValidationErrors())) { + foreach ($this->getValidators() as $validator) { + $validator($this); + + if (!empty($this->getValidationErrors())) { + break; + } + } } } }