Opened 15 years ago
Closed 15 years ago
#5930 closed Bug (fixed)
htmldataprocessor: fix for convert style attributes to lowercase in IE
| Reported by: | Juergen | Owned by: | Sa'ar Zac Elias |
|---|---|---|---|
| Priority: | Normal | Milestone: | CKEditor 3.5.1 |
| Component: | Core : Output Data | Version: | 3.0 |
| Keywords: | IE | Cc: | ckeditor@… |
Description
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 ( CKEDITOR.env.ie )
{
// IE outputs style attribute in capital letters. We should convert
// them back to lower case.
defaultHtmlFilterRules.attributes.style = 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)
Change History (14)
comment:1 Changed 15 years ago by
| Keywords: | Confirmed HasPatch added; defaultHtmlFilterRules attributes style toLowerCase removed |
|---|---|
| Milestone: | CKEditor 3.x |
comment:2 Changed 15 years ago by
Changed 15 years ago by
| Attachment: | 5930.patch added |
|---|
comment:3 Changed 15 years ago by
| Keywords: | Review? added |
|---|---|
| Owner: | set to Sa'ar Zac Elias |
| Status: | new → assigned |
comment:4 Changed 15 years ago by
This appears to be a larger problem with the CSSNormalizer. The lower case function also should not be applied to font names. See: http://cksource.com/forums/viewtopic.php?f=11&t=19446
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 15 years ago by
ignore previous comment. Proposed patch fixes it (In the scope of this bug)
comment:6 Changed 15 years ago by
| Cc: | ckeditor@… added |
|---|---|
| Keywords: | HasPatch added; HasPatch? removed |
| Version: | 3.3.1 → 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!
Thanks
comment:8 Changed 15 years ago by
| Milestone: | → CKEditor 3.5.1 |
|---|
comment:9 Changed 15 years ago by
| Status: | review → review_failed |
|---|
Could be even simplified?
return value.replace( /(^|;)([^\:]+)/g, function( match )
{
return match.toLowerCase();
});
Changed 15 years ago by
| Attachment: | 5930_2.patch added |
|---|
comment:10 Changed 15 years ago by
| Status: | review_failed → review |
|---|
comment:11 Changed 15 years ago by
| Keywords: | Confirmed HasPatch removed |
|---|---|
| Status: | review → review_passed |
comment:12 Changed 15 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | review_passed → closed |
Fixed with [6294].

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