Opened 7 years ago

Closed 6 years ago

#5930 closed Bug (fixed)

htmldataprocessor: fix for convert style attributes to lowercase in IE

Reported by: Juergen Owned by: Saare
Priority: Normal Milestone: CKEditor 3.5.1
Component: Core : Output Data Version: 3.0
Keywords: IE Cc: ckeditor@…


File: _source/plugins/htmldataprocessor/plugin.js (Starting line 240)

The function to convert ALL styles to lowercase causing a problem with capital urls:

background-image: url(http://somedomain/SomeBackground.jpg);

is converted to:

background-image: url(http://somedomain/somebackground.jpg);

On a windows server, this is not the biggest problem, but a linux server won't find that file.

Heres the possible fix:

	if ( )
		// IE outputs style attribute in capital letters. We should convert
		// them back to lower case. = function( value, element )
			var res = value.match(/([a-z-]+):/gi);
			if (res) {
				for (var i = 0; i < res.length; ++i) {
					value = value.replace(res[i], res[i].toLowerCase());
				return value;
			else {
				return value.toLowerCase();

Greetings, Juergen

Attachments (2)

5930.patch (758 bytes) - added by Saare 7 years ago.
5930_2.patch (898 bytes) - added by Saare 6 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 7 years ago by tobiasz.cudnik

  • Keywords Confirmed HasPatch added; defaultHtmlFilterRules attributes style toLowerCase removed
  • Milestone CKEditor 3.x deleted

comment:2 Changed 7 years ago by tobiasz.cudnik

I've been able to reproduce it, thank you for the fix. We will check it.

Changed 7 years ago by Saare

comment:3 Changed 7 years ago by Saare

  • Keywords Review? added
  • Owner set to Saare
  • Status changed from new to assigned

comment:4 Changed 7 years ago by comp615

This appears to be a larger problem with the CSSNormalizer. The lower case function also should not be applied to font names. See:

I.E. Instead of outputting: style="font-family: comic sans ms,cursive;" We should get: style="font-family: Comic Sans MS, cursive;"

Since that's what we gave in the fonts plugin and it's possible for fonts to be case-sensitive on certain systems. (In general isn't CSS case-sensitive?)

comment:5 Changed 7 years ago by comp615

ignore previous comment. Proposed patch fixes it (In the scope of this bug)

comment:6 Changed 7 years ago by Kingsquare

  • Cc ckeditor@… added
  • Keywords HasPatch added; HasPatch? removed
  • Version changed from 3.3.1 to 3.4.2

This problem still exists in 3.4.2. and again: the patch above fixes this problem.

Please apply this patch for the next release!


comment:7 Changed 7 years ago by Saare

  • Version changed from 3.4.2 to 3.0

Please don't change the version field.

comment:8 Changed 6 years ago by wwalc

  • Milestone set to CKEditor 3.5.1

comment:9 Changed 6 years ago by garry.yao

  • Status changed from review to review_failed

Could be even simplified?

return value.replace( /(^|;)([^\:]+)/g, function( match )
	return match.toLowerCase();

Changed 6 years ago by Saare

comment:10 Changed 6 years ago by Saare

  • Status changed from review_failed to review

comment:11 Changed 6 years ago by garry.yao

  • Keywords Confirmed HasPatch removed
  • Status changed from review to review_passed

comment:12 Changed 6 years ago by Saare

  • Resolution set to fixed
  • Status changed from review_passed to closed

Fixed with [6294].

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy