mirror of
https://github.com/mrclay/minify.git
synced 2025-08-15 10:34:02 +02:00
CSS_UriRewriter: do not rewrite about:blank
This commit is contained in:
@@ -284,6 +284,7 @@ class Minify_CSS_UriRewriter {
|
|||||||
}
|
}
|
||||||
// analyze URI
|
// analyze URI
|
||||||
if ('/' !== $uri[0] // root-relative
|
if ('/' !== $uri[0] // root-relative
|
||||||
|
&& 0 !== strpos($uri, 'about:blank') //about:blank
|
||||||
&& false === strpos($uri, '//') // protocol (non-data)
|
&& false === strpos($uri, '//') // protocol (non-data)
|
||||||
&& 0 !== strpos($uri, 'data:') // data protocol
|
&& 0 !== strpos($uri, 'data:') // data protocol
|
||||||
) {
|
) {
|
||||||
|
@@ -12,3 +12,5 @@ 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('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("//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 */
|
||||||
|
@@ -12,3 +12,5 @@ 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('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("//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 */
|
||||||
|
@@ -12,3 +12,5 @@ foo {background:url('bar/foo.png')}
|
|||||||
foo {background:url('http://foo.com/css/foo.css');} /* abs, should not alter */
|
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("//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