Skip to content

Commit

Permalink
fixed url check
Browse files Browse the repository at this point in the history
  • Loading branch information
akaunderr committed Jan 9, 2024
1 parent 7a35b8b commit 820215f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ShrinkWrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ private function minRefByType(string $type = 'js'): void {

$fname = $e->getAttribute($attr);

if (filter_var($fname, FILTER_VALIDATE_URL)) continue; // skip url sources
if (filter_var($fname, FILTER_VALIDATE_URL)) continue;
$parsed_url = parse_url($fname);
if (isset($parsed_url['scheme']) || isset($parsed_url['host'])) continue;
if (!is_file($fname)) continue;

if ($this->doLog) {
Expand Down

0 comments on commit 820215f

Please sign in to comment.