Opened 9 years ago

Closed 9 years ago

#2149 closed Bug (fixed)

Stylesheets with custom css urls are not attached to the editorarea

Reported by: jonhg Owned by: fredck
Priority: Normal Milestone: FCKeditor 2.6.2
Component: General Version: FCKeditor 2.6
Keywords: Confirmed Review+ Cc:


We need to generate the css rules for each user which are using the fckeditor. To achieve this our css files are parsed as php files. To get correct css rules we send in the id as a GET parameter to the css files.

In this way we get urls like: /styles.css?id=15

This does not work with the new css cache feature in fckeditor. The problem is the regex used at least two places in fcktools.js (FCKTools.AppendStyleSheet and FCKTools.GetStyleHTML) which look like "/[

I have temporary changed the regex to /[
\/\.].*$/ in our solution, but you guys will surely come up with a better solution.

And why your at it, why don't you move this regex rule to your fckregexlib? At least it will be easier to customize.

Attachments (1)

2149.patch (1.6 KB) - added by fredck 9 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 9 years ago by jonhg

I realize that this bug is mostly our own fault, because of our special way of dealing with css files. But as previously mentioned it would have been easier to customize this rule if it was moved into the the regex lib. Now I have to redeclare both functions only because of my little tweak.

btw, currently I'm using "/[
\/\.][\w\?\=]*$/" as the regex.

comment:2 Changed 9 years ago by fredck

  • Keywords Confirmed HasPatch added
  • Milestone set to FCKeditor 2.6.1
  • Version set to FCKeditor 2.6

Just found another solution proposed at our forums:


Still to check though.

comment:3 Changed 9 years ago by alfonsoml

this last proposal can only work if the query string is just some numbers. It will fail for basic things like ?user=391&style=silver

Changed 9 years ago by fredck

comment:4 Changed 9 years ago by fredck

  • Keywords Review? added; HasPatch removed
  • Owner set to fredck
  • Status changed from new to assigned

The "{" and "}" characters, other then been quite uncommon in URLs, are actually considered unsafe as per RFC. So, the proposed patch is checking for those chars now, which are required for any CSS definitions instead.

comment:5 Changed 9 years ago by martinkou

  • Keywords Review+ added; Review? removed

comment:6 Changed 9 years ago by fredck

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

Fixed with [2097].

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