Opened 16 years ago

Closed 16 years ago

#2149 closed Bug (fixed)

Stylesheets with custom css urls are not attached to the editorarea

Reported by: Jon Håvard Gundersen Owned by: Frederico Caldeira Knabben
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 (1)

2149.patch (1.6 KB) - added by Frederico Caldeira Knabben 16 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 16 years ago by Jon Håvard Gundersen

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 16 years ago by Frederico Caldeira Knabben

Keywords: Confirmed HasPatch added
Milestone: FCKeditor 2.6.1
Version: FCKeditor 2.6

Just found another solution proposed at our forums:

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

Still to check though.

comment:3 Changed 16 years ago by Alfonso Martínez de Lizarrondo

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 16 years ago by Frederico Caldeira Knabben

Attachment: 2149.patch added

comment:4 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review? added; HasPatch removed
Owner: set to Frederico Caldeira Knabben
Status: newassigned

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 16 years ago by Martin Kou

Keywords: Review+ added; Review? removed

comment:6 Changed 16 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: assignedclosed

Fixed with [2097].

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