Bug #66844
closedCSS inline style for image border gets corrupted after saving
100%
Description
Hello,
there could be a bug in typo3/sysext/core/Classes/Html/RteHtmlParser.php
Because it seems there are no other complaints about this, and this is a prominent feature, the bug could also be a part of my configuration. I use typo3 6.2.12.
When I want an image inside a tt_news text entry (rtehtmlarea) to have a border (checkbox "border" in "edit image") an inline style is added to it:
"border-style: solid; border-width: thin;"
After saving the entry the html gets mangled to
"border-style: solid; border-"
and so the border is not shown.
I chased it down to
typo3/sysext/core/Classes/Html/RteHtmlParser.php
At line 476 in 6.2.12 there is a regex which tries to remove the css-width of an image (to add it later again as attribute). But this regex also captures the "border-width". After changing the regex to
'/((?:^|[^\-;])\\s*(?:width|height)\\s*:[^;]*(?:$|;))/si'
this is corrected, but I really don't know enough about this system to know if this is sufficient.
The regex later in the file (line 1601) which adds the width part again, should probably also get checked.