diff --git a/min/lib/Minify/CSS/UriRewriter.php b/min/lib/Minify/CSS/UriRewriter.php index 8845f15..e1c67ed 100644 --- a/min/lib/Minify/CSS/UriRewriter.php +++ b/min/lib/Minify/CSS/UriRewriter.php @@ -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 ) { diff --git a/min_unit_tests/_test_files/css_uriRewriter/exp.css b/min_unit_tests/_test_files/css_uriRewriter/exp.css index d749295..8a30a2d 100644 --- a/min_unit_tests/_test_files/css_uriRewriter/exp.css +++ b/min_unit_tests/_test_files/css_uriRewriter/exp.css @@ -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 */ \ No newline at end of file +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 */ diff --git a/min_unit_tests/_test_files/css_uriRewriter/exp_prepend.css b/min_unit_tests/_test_files/css_uriRewriter/exp_prepend.css index 87b7ecb..251c593 100644 --- a/min_unit_tests/_test_files/css_uriRewriter/exp_prepend.css +++ b/min_unit_tests/_test_files/css_uriRewriter/exp_prepend.css @@ -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 */ \ No newline at end of file +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 */ diff --git a/min_unit_tests/_test_files/css_uriRewriter/exp_prepend2.css b/min_unit_tests/_test_files/css_uriRewriter/exp_prepend2.css index ceea4ec..3460cfb 100644 --- a/min_unit_tests/_test_files/css_uriRewriter/exp_prepend2.css +++ b/min_unit_tests/_test_files/css_uriRewriter/exp_prepend2.css @@ -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 */ \ No newline at end of file +foo {background:url(data:image/gif;base64,AAAA);} /* data, should not alter */ diff --git a/min_unit_tests/_test_files/css_uriRewriter/in.css b/min_unit_tests/_test_files/css_uriRewriter/in.css index aa41d0a..df80a22 100644 --- a/min_unit_tests/_test_files/css_uriRewriter/in.css +++ b/min_unit_tests/_test_files/css_uriRewriter/in.css @@ -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 */ \ No newline at end of file +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 */