Don't use absolute link in image urls. That's all. :)

CommentFileSizeAuthor
#4 absolute-links-1315110-4.patch666 bytesjoelstein

Comments

EllECTRONC’s picture

Title: Don't user absolute link in image urls » Don't USE absolute link in image urls

:)

dalin’s picture

Priority: Normal » Major

Upping this to major since this can cause broken images when one of the CSS files created by this module is shared between multiple domains and one of those domains is private (say for example when you route content editors through a private domain that is restricted via HTTP authentication, VPN, private DNS or whatever).

This will also make it more difficult to make the module compatible with all of the various CDN technologies out there.

acrollet’s picture

Version: 7.x-3.0-alpha1 » 7.x-3.x-dev
Status: Active » Closed (fixed)
joelstein’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new666 bytes

There's a problem with the solution that got committed. It doesn't resolve internal file URIs, like file_create_url() did. For example, now I'm seeing this in my CSS if I choose an image style:

background-image: url(/public://styles/none/public/menu_icons/menu_icon_821.png)

We should use file_create_url() to resolve the internal URI, and then strip out the base url. See the attached patch, which works for me.

acrollet’s picture

Status: Needs review » Closed (duplicate)

This is fixed in dev, and is also a duplicate of #1399516: Icons disappear after update.