[BUGFIX] Properly match html tags with data-* attributes
The cropHTML method needs to account for html tags - therefore it must match them. The regex used for matching tags misses html tags with attributes that contain dashes. (\w matches "any 'word' character", being "[…] any letter or digit or the underscore character […]") [1]. The current W3C html draft sets even less constraints on what makes an attribute name [2], but including dashes looks like the most urgent need. [1] http://php.net/manual/en/regexp.reference.escape.php [2] http://www.w3.org/TR/html51/syntax.html#attributes-0 Resolves: #63086 Releases: master, 6.2 Change-Id: I52832ca3e8d9660faa939e673af6cdc32f310b18 Reviewed-on: http://review.typo3.org/34371 Reviewed-by:Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Helmut Hummel <helmut.hummel@typo3.org> Reviewed-by:
Markus Klein <klein.t3@reelworx.at> Tested-by:
Markus Klein <klein.t3@reelworx.at>
Showing
- typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php 1 addition, 1 deletion.../frontend/Classes/ContentObject/ContentObjectRenderer.php
- typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php 86 additions, 75 deletions...nd/Tests/Unit/ContentObject/ContentObjectRendererTest.php
Please register or sign in to comment