matthiasmullie / minify

CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.
https://matthiasmullie.github.io/minify/
MIT License
1.97k stars 309 forks source link

openbasedir restrictions throws exception with is_file() #417

Open AnnoyingTechnology opened 8 months ago

AnnoyingTechnology commented 8 months ago

Context: I only pass local CSS files to Minify, all of them allowed by openbasedir.

Minify scans the contents of the CSS files, and runs is_file() on base64 encoded contents and other stuff contained within the CSS files.

Examples :

Expected behavior :

AnnoyingTechnology commented 8 months ago

Apparently, there is an @ already, but that doesn't cut it.

return strlen($path) < PHP_MAXPATHLEN && @is_file($path) && is_readable($path);

https://github.com/matthiasmullie/minify/blob/master/src/Minify.php#L504