Opened 10 years ago

Last modified 8 years ago

#12458 confirmed Bug

CSS style attribute values with semicolons converted to lowercase in IE

Reported by: Jeroen Owned by:
Priority: Normal Milestone:
Component: Core : Output Data Version: 4.3
Keywords: IE Cc:

Description

When pasting this source code into CKEditor (tested with 4.4.4) in Internet Explorer (tested with IE11):

<div style="background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==')">Foo</div>

It is changed into the following code when switching back to the WYSIWYG view:

<div style="background-image: url(&quot;data:image/png;base64,ivborw0kggoaaaansuheugaaaauaaaafcayaaacnbyblaaaaheleqvqi12p4//8/w38giaxdibke0dhxgljnbaao9txl0y4ohwaaaabjru5erkjggg==&quot;);">Foo</div>

Because data URIs are case-sensitive, the image becomes invalid.

The cause is the semicolon before base64. This part of htmldataprocessor.js contains the bug:

if ( CKEDITOR.env.ie ) {
	// IE outputs style attribute in capital letters. We should convert
	// them back to lower case, while not hurting the values (#5930)
	defaultHtmlFilterRulesForAll.attributes.style = function( value, element ) {
		return value.replace( /(^|;)([^\:]+)/g, function( match ) {
			alert(match);
			return match.toLowerCase();
		} );
	};
}

Change History (2)

comment:1 Changed 10 years ago by Jakub Ś

Keywords: IE added
Status: newconfirmed
Version: 4.4.44.3

Problem can be reproduced from CKEditor 4.3 in IE8-11.

comment:2 Changed 8 years ago by Jakub Ś

This bug depends on #7352.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy