Minify_getUri function missing PHP querystring operator in resulting HTML
rexhaugen opened this issue · 0 comments
I'm using the code below in a website to minify a bunch of CSS files. I noted that the CSS was not being loaded because the URI inserted in the HTML did not contain a querystring operator. I had to modify the /min/lib/Minify/HTML/Helper.php file in order for the the code to work. Could this be caused by a server configuration error?
Code used to minify batch:
<?php
require '/path/to/min/utils.php';
$cssUri = Minify_getUri([ // a list of files
'/path/to/css/html5.css',
'/path/to/css/1140.css',
'/path/to/css/theme.css',
'/path/to/css/custom.css',
'/path/to/css/prettyphoto.css',
'/path/to/css/validationEngine.jquery.css',
]);
echo "<link rel=stylesheet href='{$cssUri}'>";
?>
Original resulting code in HTML:
<link rel=stylesheet href='/min/b=css&f=html5.css,1140.css,theme.css,custom.css,prettyphoto.css,validationEngine.jquery.css&1396552510'>
Original line 243 in /min/lib/Minify/HTML/Helper.php:
$bUri = $minRoot . 'b=' . $base . '&f=' . implode(',', $basedPaths);
Modified line 243 in /min/lib/Minify/HTML/Helper.php:
$bUri = $minRoot . '?b=' . $base . '&f=' . implode(',', $basedPaths);
Modified resulting code in HTML:
<link rel=stylesheet href='/min/?b=css&f=html5.css,1140.css,theme.css,custom.css,prettyphoto.css,validationEngine.jquery.css&1396552510'>