Closed Daniel15 closed 12 years ago
This is a known issue with the CSS URL rewriting class I'm using. Possible fixes are:
Option 1. is nicer, but I'm afraid it will break some corner case, which makes me loathe to do it. 2. is more messy, but is a safer fix.
I'm not going to have time to tackle this for a few days, but any pull requests will be gladly accepted. If you read classes/casset/cssurirewriter.php, you'll see the rewrite method has a 4th argument, $symlinks
. We just need to pass in something appropriate.
In my case (and others, I'd assume), my CSS files are at /assets/css and the Casset versions are at /assets/cache/. In this case, the relative URLs are still valid (the CSS uses image paths like ../img/blah.png). So for now, maybe adding the ability to turn off CSS URL rewriting via the configuration would be good enough.
A problem with that is that people put images which are referenced by css (backgrounds, etc) inside the css folder. These will all break if I don't do rewriting.
Right now I'm tempted to give people the option to choose their rewriter: Leave absolute as the default, add in relative (it's a really trivial piece of code), and give them the option to turn it off.
I should be able to get onto it tonight.
Right! I'm really sorry for the delay. Exams are, however, now over.
Would you mind checking the feature/uri_rewriter branch? Readme diff (which documents the new stuff) is here. I thought combining the relative algorithm, and the option to disable rewriting, into one option was sensible, which is why I haven't merged your pull request (although thanks for submitting it!).
Thanks!
I haven't heard anything for a while, so I went ahead and merged the branch, and pushed a new release.
I'm encountering an issue with URLs being rewritten incorrectly in CSS files.
My setup is as follows:
/var/www/atarcalc/live/
(so there's /var/www/atarcalc/live/fuel/ and /var/www/atarcalc/live/public/)/var/www/atarcalc/public/
is the web root of the websiteThe CSS files get combined correctly, but the file paths contained within are incorrect. When I use something like
url(../img/background.png)
in a CSS file, it comes through in the combined version asurl(ublic/assets/img/background.png)
. This should beurl(/assets/img/background.png)
.