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.
Updated by Riccardo De Contardi about 9 years ago
I can confirm that:
1) It is still present on 6.2.14 and 7 (latest master)
2) it does not depend from tt_news, it occurs even with a plain "Text" content element.
Updated by Dennis Lümkemann about 9 years ago
Same problem here with Typo3 6.2.14 and an image inside a table in a text content element.
Updated by Dennis Lümkemann about 9 years ago
Is there a chance this we can change the priority to must-have? This is an obvious bug that didn't exist in previous versions and shouldn't be too hard to fix. Thanks.
Updated by Riccardo De Contardi almost 9 years ago
- Category set to RTE (rtehtmlarea + ckeditor)
Updated by Riccardo De Contardi over 8 years ago
- Target version set to Candidate for patchlevel
Updated by Riccardo De Contardi over 8 years ago
I can confirm it is still present in the latest master 8.0-dev
Updated by Frank Nägler about 8 years ago
- Status changed from New to In Progress
- Assignee set to Frank Nägler
Updated by Gerrit Code Review about 8 years ago
- Status changed from In Progress to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48408
Updated by Frank Nägler about 8 years ago
please testing this fix very carefully, especially for 6.2
Updated by Frank Nägler about 8 years ago
- Target version changed from Candidate for patchlevel to 8.2
- Sprint Focus set to Stabilization Sprint
Updated by Gerrit Code Review about 8 years ago
Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48441
Updated by Frank Nägler about 8 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset d701d348b14904c5c3452eb950f6cc9e78b838d7.
Updated by Frank Nägler about 8 years ago
no backport to 6.2, this issue is not important enough and not a security issue.
Updated by Riccardo De Contardi almost 7 years ago
- Status changed from Resolved to Closed