[BUGFIX] Keep hyphens in custom HTML5 attributes
authorJigal van Hemert <jigal@xs4all.nl>
Fri, 9 Mar 2012 19:52:39 +0000 (20:52 +0100)
committerTolleiv Nietsch <info@tolleiv.de>
Mon, 12 Mar 2012 07:11:36 +0000 (08:11 +0100)
In frontend rendering hyphens in custom attribute names must be kept.
Use the same regexp as in t3lib_parsehtml keeps allowed special
characters.

Change-Id: Iacc82d8e0620f87ffa7667297b8a06be732d1297
Releases: 4.8, 4.7, 4.6, 4.5
Fixes: #34371
Reviewed-on: http://review.typo3.org/9521
Reviewed-by: Philipp Gampe
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
t3lib/class.t3lib_div.php

index fafa9bd..afb024a 100644 (file)
@@ -1999,7 +1999,7 @@ final class t3lib_div {
                                                $name = '';
                                        }
                                } else {
-                                       if ($key = strtolower(preg_replace('/[^a-zA-Z0-9]/', '', $val))) {
+                                       if ($key = strtolower(preg_replace('/[^[:alnum:]_\:\-]/', '', $val))) {
                                                $attributes[$key] = '';
                                                $name = $key;
                                        }