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 #1

Updated by Riccardo De Contardi almost 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.

Actions #2

Updated by Dennis Lümkemann over 8 years ago

Same problem here with Typo3 6.2.14 and an image inside a table in a text content element.

Actions #3

Updated by Dennis Lümkemann over 8 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.

Actions #4

Updated by Riccardo De Contardi over 8 years ago

  • Category set to RTE (rtehtmlarea + ckeditor)
Actions #5

Updated by Riccardo De Contardi over 8 years ago

  • Target version set to Candidate for patchlevel
Actions #6

Updated by Riccardo De Contardi about 8 years ago

I can confirm it is still present in the latest master 8.0-dev

Actions #7

Updated by Frank Nägler almost 8 years ago

  • Status changed from New to In Progress
  • Assignee set to Frank Nägler
Actions #8

Updated by Gerrit Code Review almost 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

Actions #9

Updated by Frank Nägler almost 8 years ago

please testing this fix very carefully, especially for 6.2

Actions #10

Updated by Frank Nägler almost 8 years ago

  • Target version changed from Candidate for patchlevel to 8.2
  • Sprint Focus set to Stabilization Sprint
Actions #11

Updated by Gerrit Code Review almost 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

Actions #12

Updated by Frank Nägler almost 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #13

Updated by Frank Nägler almost 8 years ago

no backport to 6.2, this issue is not important enough and not a security issue.

Actions #14

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF