[5.x, 4.x, 3.x]: Html::tag()
improperly parses inline data URIs in style
attributes
#14964
Labels
Html::tag()
improperly parses inline data URIs in style
attributes
#14964
What happened?
Description
If I call:
...with
$attrs
set thusly:The
::explodeStyle()
method improperly parses the data URIstyle
attributes, adding spaces and colons where they should not be. I think the regex is assuming all semi-colons end a CSS style attribute, which is not the case for data URIs. This renders an invalid style attribute:It should be this:
This affects
Html::tag()
in Craft 3.x, 4.x, and 5.xRelated issue: nystudio107/craft-imageoptimize#400
Craft CMS version
3.x, 4.x, 5.x
PHP version
n/a
Operating system and version
n/a
Database type and version
n/a
Image driver and version
n/a
Installed plugins and versions
n/a
The text was updated successfully, but these errors were encountered: