Minify version: 2.1.1
PHP version: 5.2.6
What steps will reproduce the problem?
1. Create a CSS file with the following code
#prevLink{ height: 100%; background-image: url(data:image/gif;base64,AAAA);
display: block; }
2. Run this through minify
3. Output will have changed the URL to the full path (e.g. as follows)
#prevLink{ height: 100%; background-image:
url(/path/to/directory/data:image/gif;base64,AAAA); display: block; }
Expected output:
#prevLink{ height: 100%; background-image: url(data:image/gif;base64,AAAA);
display: block; }
Actual output:
#prevLink{ height: 100%; background-image:
url(/path/to/directory/data:image/gif;base64,AAAA); display: block; }
Did any unit tests FAIL?
Didn't test them.
Please provide any additional information below.
Following fixed the issue for me.
min/lib/Minify/CSS.php
~line 275 change
if (strpos($url, '//') > 0) {
// probably starts with protocol, do not alter
} else {
to
if (strpos($url, '//') > 0) {
// probably starts with protocol, do not alter
/**
* Fixing bug in minify that breaks
url(data:image/gif;base64,AAAA);
*/
} else if( preg_match( "#^data:(.+?)/(.+?);base64,#i", $url ) ) {
// This is a data: scheme and not a path
} else {
Original issue reported on code.google.com by brandon....@gmail.com on 23 Jan 2009 at 7:31
Original issue reported on code.google.com by
brandon....@gmail.com
on 23 Jan 2009 at 7:31