Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: data-url should be treated as absolute #56

Open
rostenkowski opened this issue Jan 22, 2014 · 7 comments
Open

BUG: data-url should be treated as absolute #56

rostenkowski opened this issue Jan 22, 2014 · 7 comments

Comments

@rostenkowski
Copy link
Contributor

The CssUrlsFilter breaks the value of the CSS Data URL by adding for example /cache/ prefix to them so u get something like this in your processed stylesheet:

image: url('/cache/data:image/png,base64,iVBORw0KGgo...');

That condition should be changed to something like this (which actualy works for me)

// is already absolute
if (preg_match('/^data:|([a-z]+:\/)?\//', $url)) {
    return $url;
}
@fprochazka
Copy link
Collaborator

I'm not really sure I understand the issue.

@rostenkowski
Copy link
Contributor Author

I have updated the description, is it now more clear?

🐇

@fprochazka
Copy link
Collaborator

Now it's clear :)

@janmarek
Copy link
Owner

There some edge cases where CssUrlsFilter is not working properly. We will create better test case and try to solve these issues before releasing new stable version.

@martinknor
Copy link

Spíše bych řekl

if (preg_match("/^(data:|([a-z]+:\/)?\/)/", $url)) return $url;

@bckp
Copy link
Contributor

bckp commented Oct 14, 2014

@martinknor : IMHO, není třeba přidávat závorky, vzhledem k tomu že nás zajímá jenom jestli se regulár matchne nebo nikoliv.

@fprochazka
Copy link
Collaborator

Asi by to chtělo spíš testy, abychom měli jistotu :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants