1
0
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:
Joe Cai
2014-01-02 11:27:40 +08:00
parent 5560a664e9
commit 143046d472
5 changed files with 11 additions and 4 deletions

View File

@@ -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
) {

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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 */