Fix static analysis error in Content\Text\NPF

- Using explicit DOMAttr->name property instead of expecting the array key to be the attribute name
This commit is contained in:
Hypolite Petovan 2025-09-25 19:42:52 -04:00
commit 4afcfce6ad

View file

@ -321,8 +321,8 @@ class NPF
list($npf, $text, $formatting) = self::routeChildren($element, $uri_id, false, $callstack, $npf, $text, $formatting);
$attributes = [];
foreach ($element->attributes as $key => $attribute) {
$attributes[$key] = trim($attribute->value);
foreach ($element->attributes as $attribute) {
$attributes[$attribute->name] = trim($attribute->value);
}
if (!empty($attributes['href'])) {
$formatting[] = [