The CSS aggregator currently breaks URLs that are relative to the hostname (ex: /path/to/file) by assuming they are relative to the folder that the CSS file originated from. This causes css like:
background-image: url(/sites/all/themes/zen/ilevine/images/headerback.png);
to be changed to:
background-image:url(/sites/all/themes/zen/ilevine//sites/all/themes/zen/ilevine/images/headerback.png);
which is clearly not right.

kkaefer gave me a regular expression that fixes the problem. It also allows spaces (as allowed in the spec) between url and (.

Patch is attached.

CommentFileSizeAuthor
#2 relative_fix.patch1.01 KBandrewlevine
relative_fix.patch832 bytesandrewlevine

Comments

andrewlevine’s picture

Status: Active » Needs review
andrewlevine’s picture

StatusFileSize
new1.01 KB

oops, here's a working version of the patch.

moshe weitzman’s picture

subscribe

scott.mclewin’s picture

Thanks for this. I ran into this problem on a D5 site earlier today. I applied this change to the right line of common.inc and it did what I needed.

dries’s picture

Status: Needs review » Needs work

How does it actually differentiate paths relative to the hostname vs other relative paths?

Patch no longer applies so it needs to be rerolled. Marking it as 'code needs work'.

dpearcefl’s picture

Status: Needs work » Postponed (maintainer needs more info)

Does this issue exist in current D6?

dpearcefl’s picture

Status: Postponed (maintainer needs more info) » Needs work

We want your patch if it is still needed. Please resubmit it with a proper filename.

http://drupal.org/node/1054616
[description]-[issue-number]-[comment-number].patch

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.