Update HTMLPurifier, Guzzle and scssphp

This commit is contained in:
Kijin Sung 2025-03-05 20:32:15 +09:00
parent 074873d844
commit b5823e97e4
119 changed files with 1564 additions and 1533 deletions

View file

@ -33,7 +33,11 @@ class HTMLPurifier_AttrTransform_TargetBlank extends HTMLPurifier_AttrTransform
// XXX Kind of inefficient
$url = $this->parser->parse($attr['href']);
$scheme = $url->getSchemeObj($config, $context);
// Ignore invalid schemes (e.g. `javascript:`)
if (!($scheme = $url->getSchemeObj($config, $context))) {
return $attr;
}
if ($scheme->browsable && !$url->isBenign($config, $context)) {
$attr['target'] = '_blank';