From 93f43f785c2629b1ca067dc85736157779b1f14b Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 30 Aug 2024 10:28:39 +0200 Subject: [PATCH] [BUGFIX] fix invalid phone regex The dash at the end of the regex is interpreted as regex group in chrome and firefox so we have to escape it --- .../Validation/ValidationDataAttributeViewHelper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/ViewHelpers/Validation/ValidationDataAttributeViewHelper.php b/Classes/ViewHelpers/Validation/ValidationDataAttributeViewHelper.php index 4707d7bf4..35a1f0ae8 100644 --- a/Classes/ViewHelpers/Validation/ValidationDataAttributeViewHelper.php +++ b/Classes/ViewHelpers/Validation/ValidationDataAttributeViewHelper.php @@ -195,13 +195,13 @@ protected function addValidationAttributes(array $additionalAttributes, Field $f * * html5 example: * + * pattern="/^(\+\d{1,4}|0+\d{1,5}|\(\d{1,5})[\d\s\/\(\)\-]*\d+$/" /> * javascript example: * + * "/^(\+\d{1,4}|0+\d{1,5}|\(\d{1,5})[\d\s\/\(\)\-]*\d+$/" /> */ case 3: - $pattern = '^(\+\d{1,4}|0+\d{1,5}|\(\d{1,5})[\d\s\/\(\)-]*\d+$'; + $pattern = '^(\+\d{1,4}|0+\d{1,5}|\(\d{1,5})[\d\s\/\(\)\-]*\d+$'; if ($this->isNativeValidationEnabled()) { $additionalAttributes['pattern'] = $pattern; } else {