[BUGFIX] Properly match html tags with data-* attributes 06/34406/2
authorLudwig Rafelsberger <ludwig.rafelsberger@gmx.at>
Wed, 19 Nov 2014 21:38:21 +0000 (22:38 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Thu, 20 Nov 2014 19:35:59 +0000 (20:35 +0100)
commit77f7fa27054e1402a639e103a4b8ca3a947ebb5d
treec491880bd7d0d39de6fe38ac77718414a848fdb4
parentc3443dff7869992c8d0fd88ed3e9969ca6df734b
[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/34406
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php