Ignore script and style blocks in favicon parsing

This commit is contained in:
Chirag Aggarwal
2026-04-06 20:42:31 +05:30
parent 9dbc32d722
commit 92166384d3
@@ -97,7 +97,10 @@ class Get extends Action
$space = 0;
$linkTags = [];
$html = \preg_replace('/<!--.*?-->/s', '', $res->getBody()) ?? $res->getBody();
$html = $res->getBody();
$html = \preg_replace('/<!--.*?-->/s', '', $html) ?? $html;
$html = \preg_replace('/<script\b[^>]*>.*?<\/script>/is', '', $html) ?? $html;
$html = \preg_replace('/<style\b[^>]*>.*?<\/style>/is', '', $html) ?? $html;
\preg_match_all('/<link\b[^>]*>/i', $html, $linkTags);
foreach ($linkTags[0] ?? [] as $tag) {