diff --git a/modules/config_games/config_servers.php b/modules/config_games/config_servers.php index b828c8a3..5e09b632 100644 --- a/modules/config_games/config_servers.php +++ b/modules/config_games/config_servers.php @@ -30,6 +30,13 @@ function config_games_normalize_path($path) return ltrim($clean, '/'); } +function config_games_next_form_key(): string +{ + static $counter = 0; + $counter++; + return 'node_' . $counter; +} + function config_games_print_editor_css() { static $printed = false; @@ -73,6 +80,8 @@ function config_games_render_node(SimpleXMLElement $node, array $ancestors, arra $value = (string)$node; $safeLabel = htmlspecialchars($name, ENT_QUOTES, 'UTF-8'); $safePath = htmlspecialchars($path, ENT_QUOTES, 'UTF-8'); + $nodeKey = config_games_next_form_key(); + $safeNodeKey = htmlspecialchars($nodeKey, ENT_QUOTES, 'UTF-8'); $displayPath = htmlspecialchars(str_replace('[', '[', $rawPath), ENT_QUOTES, 'UTF-8'); $isScript = in_array(strtolower($name), ['pre_install','post_install','precmd','postcmd','cli_template']); @@ -80,22 +89,22 @@ function config_games_render_node(SimpleXMLElement $node, array $ancestors, arra $actionId = 'node_action_' . substr(md5($safePath . $index), 0, 8); $html .= "
This element contains nested tags; clearing the text does not remove children.
"; } @@ -105,12 +114,12 @@ function config_games_render_node(SimpleXMLElement $node, array $ancestors, arra foreach ($attributes as $attrName => $attrValue) { $attrSafe = htmlspecialchars($attrName, ENT_QUOTES, 'UTF-8'); $valSafe = htmlspecialchars((string)$attrValue, ENT_QUOTES, 'UTF-8'); - $html .= "