mirror of
https://github.com/mrclay/minify.git
synced 2025-08-12 00:54:35 +02:00
CSS_UriRewriter: do not rewrite about:blank
This commit is contained in:
@@ -284,6 +284,7 @@ class Minify_CSS_UriRewriter {
|
||||
}
|
||||
// analyze URI
|
||||
if ('/' !== $uri[0] // root-relative
|
||||
&& 0 !== strpos($uri, 'about:blank') //about:blank
|
||||
&& false === strpos($uri, '//') // protocol (non-data)
|
||||
&& 0 !== strpos($uri, 'data:') // data protocol
|
||||
) {
|
||||
|
@@ -11,4 +11,6 @@
|
||||
foo {background:url('/_test_files/css_uriRewriter/bar/foo.png')}
|
||||
foo {background:url('http://foo.com/css/foo.css');} /* abs, should not alter */
|
||||
foo {background:url("//foo.com/css/foo.css");} /* protocol relative, should not alter */
|
||||
foo {background:url(data:image/gif;base64,AAAA);} /* data, should not alter */
|
||||
foo {background:url(data:image/gif;base64,AAAA);} /* data, should not alter */
|
||||
foo {background:url(about:blank);} /* about:blank, should not alter */
|
||||
foo {background:url(about:blank#tab-a);} /* about:blank with a fragment identifier, should not alter */
|
||||
|
@@ -11,4 +11,6 @@
|
||||
foo {background:url('http://cnd.com/A/B/bar/foo.png')}
|
||||
foo {background:url('http://foo.com/css/foo.css');} /* abs, should not alter */
|
||||
foo {background:url("//foo.com/css/foo.css");} /* protocol relative, should not alter */
|
||||
foo {background:url(data:image/gif;base64,AAAA);} /* data, should not alter */
|
||||
foo {background:url(data:image/gif;base64,AAAA);} /* data, should not alter */
|
||||
foo {background:url(about:blank);} /* about:blank, should not alter */
|
||||
foo {background:url(about:blank#tab-a);} /* about:blank with a fragment identifier, should not alter */
|
||||
|
@@ -11,4 +11,4 @@
|
||||
foo {background:url('//cnd.com/A/B/bar/foo.png')}
|
||||
foo {background:url('http://foo.com/css/foo.css');} /* abs, should not alter */
|
||||
foo {background:url("//foo.com/css/foo.css");} /* protocol relative, should not alter */
|
||||
foo {background:url(data:image/gif;base64,AAAA);} /* data, should not alter */
|
||||
foo {background:url(data:image/gif;base64,AAAA);} /* data, should not alter */
|
||||
|
@@ -11,4 +11,6 @@
|
||||
foo {background:url('bar/foo.png')}
|
||||
foo {background:url('http://foo.com/css/foo.css');} /* abs, should not alter */
|
||||
foo {background:url("//foo.com/css/foo.css");} /* protocol relative, should not alter */
|
||||
foo {background:url(data:image/gif;base64,AAAA);} /* data, should not alter */
|
||||
foo {background:url(data:image/gif;base64,AAAA);} /* data, should not alter */
|
||||
foo {background:url(about:blank);} /* about:blank, should not alter */
|
||||
foo {background:url(about:blank#tab-a);} /* about:blank with a fragment identifier, should not alter */
|
||||
|
Reference in New Issue
Block a user