Skip to content

Commit

Permalink
Don't import specific files
Browse files Browse the repository at this point in the history
Fixes #224
  • Loading branch information
matthiasmullie committed Feb 2, 2018
1 parent 4ca8d1e commit 57b3819
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Minify.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,16 @@ protected function restoreExtractedData($content)
*/
protected function canImportFile($path)
{
$parsed = parse_url($path);
if (
// file is elsewhere
isset($parsed['host']) ||
// file responds to queries (may change, or need to bypass cache)
isset($parsed['query'])
) {
return false;
}

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

Expand Down

0 comments on commit 57b3819

Please sign in to comment.