[BUGFIX] EXT:form - Change regexp for identifier escaping 96/51996/3
authorMartin Kutschker <masi@typo3.org>
Fri, 3 Mar 2017 22:42:48 +0000 (22:42 +0000)
committerSusanne Moog <susanne.moog@typo3.org>
Sun, 12 Mar 2017 09:57:23 +0000 (10:57 +0100)
Change regexp for identifier escaping of forms to work
for underscores and dashes.

Resolves: #80229
Releases: master
Change-Id: I2d76da7b42039cc13429344ca82120bf60b0ab13
Reviewed-on: https://review.typo3.org/51996
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
Tested-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/form/Classes/Domain/Model/FormElements/AbstractFormElement.php

index de9026e..bd61d44 100644 (file)
@@ -86,7 +86,7 @@ abstract class AbstractFormElement extends AbstractRenderable implements FormEle
     {
         $formDefinition = $this->getRootForm();
         $uniqueIdentifier = sprintf('%s-%s', $formDefinition->getIdentifier(), $this->identifier);
-        $uniqueIdentifier = preg_replace('/[^a-zA-Z0-9-_]/', '_', $uniqueIdentifier);
+        $uniqueIdentifier = preg_replace('/[^a-zA-Z0-9_-]/', '_', $uniqueIdentifier);
         return lcfirst($uniqueIdentifier);
     }