WebLoader icon indicating copy to clipboard operation
WebLoader copied to clipboard

BUG: data-url should be treated as absolute

Open stepansvoboda opened this issue 11 years ago • 7 comments
trafficstars

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;
}

stepansvoboda avatar Jan 22 '14 01:01 stepansvoboda

I'm not really sure I understand the issue.

fprochazka avatar Jan 26 '14 15:01 fprochazka

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

:rabbit2:

stepansvoboda avatar Jan 26 '14 19:01 stepansvoboda

Now it's clear :)

fprochazka avatar Jan 27 '14 00:01 fprochazka

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.

janmarek avatar Jan 31 '14 09:01 janmarek

Spíše bych řekl

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

martinknor avatar Mar 31 '14 19:03 martinknor

@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.

bckp avatar Oct 14 '14 15:10 bckp

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

fprochazka avatar Oct 14 '14 15:10 fprochazka