Ticket #2149 (closed Bug: fixed)

Opened 4 months ago

Last modified 2 months ago

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:

Description

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 "/[\\\/\.]\w*$/"

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

2149.patch (1.6 kB) - added by fredck 2 months ago.

Change History

Changed 4 months 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.

Changed 3 months ago by fredck

  • keywords Confirmed HasPatch added
  • version set to FCKeditor 2.6
  • milestone set to FCKeditor 2.6.1

Just found another solution proposed at our forums:

/[\\\/\.]\w*(\?\d+)?$/

Still to check though.

Changed 3 months 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 2 months ago by fredck

Changed 2 months 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.

Changed 2 months ago by martinkou

  • keywords Review+ added; Review? removed

Changed 2 months ago by fredck

  • status changed from assigned to closed
  • resolution set to fixed

Fixed with [2097].

Note: See TracTickets for help on using tickets.