[BUGFIX] Properly match html tags with data-* attributes 71/34371/8
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:20:46 +0000 (20:20 +0100)
commit1b06d47e40119f2f97949d8144128f00535ca5fb
tree7d121f91547c27d77e3398d0aa1bb1228f41759b
parent0829498d1b29d0eb466c780c649ff616b423031b
[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>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php