Project

General

Profile

Actions

Bug #66844

closed

CSS inline style for image border gets corrupted after saving

Added by terf no-lastname-given almost 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
Start date:
2015-05-07
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Stabilization Sprint

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.

Actions

Also available in: Atom PDF