Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minify_getUri function missing PHP querystring operator in resulting HTML #641

Open
rexhaugen opened this issue Oct 2, 2018 · 0 comments

Comments

@rexhaugen
Copy link

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&amp;f=html5.css,1140.css,theme.css,custom.css,prettyphoto.css,validationEngine.jquery.css&amp;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&amp;f=html5.css,1140.css,theme.css,custom.css,prettyphoto.css,validationEngine.jquery.css&amp;1396552510'>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant