Apply automated PHP8 safety transforms

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/89922108-1604-44ae-949d-358d32b9d70a

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-23 14:01:37 +00:00 committed by GitHub
parent aca850b6cd
commit e44519c030
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
465 changed files with 1716 additions and 1716 deletions

View file

@ -216,7 +216,7 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer
return array();
}
$array = array();
foreach ($node_map as $attr) {
foreach ((array)$node_map as $attr) {
$array[$attr->name] = $attr->value;
}
return $array;

View file

@ -1850,7 +1850,7 @@ class HTML5TreeConstructer
is already present on the top element of the stack of open elements.
If it is not, add the attribute and its corresponding value to that
element. */
foreach ($token['attr'] as $attr) {
foreach ((array)$token['attr'] as $attr) {
if (!$this->stack[0]->hasAttribute($attr['name'])) {
$this->stack[0]->setAttribute($attr['name'], $attr['value']);
}
@ -2231,7 +2231,7 @@ class HTML5TreeConstructer
add the attribute and its corresponding value to that
element. */
} else {
foreach ($token['attr'] as $attr) {
foreach ((array)$token['attr'] as $attr) {
if (!$this->stack[1]->hasAttribute($attr['name'])) {
$this->stack[1]->setAttribute($attr['name'], $attr['value']);
}
@ -4408,7 +4408,7 @@ class HTML5TreeConstructer
$el = $this->dom->createElement($token['name']);
foreach ($token['attr'] as $attr) {
foreach ((array)$token['attr'] as $attr) {
if (!$el->hasAttribute($attr['name'])) {
$el->setAttribute($attr['name'], $attr['value']);
}
@ -4466,7 +4466,7 @@ class HTML5TreeConstructer
private function elementInScope($el, $table = false)
{
if (is_array($el)) {
foreach ($el as $element) {
foreach ((array)$el as $element) {
if ($this->elementInScope($element, $table)) {
return true;
}