Refine language fallback warning matcher and legacy editor label text

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/b16096ca-4ef7-4bb0-80e8-658767561478

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-06 23:03:18 +00:00 committed by GitHub
parent 09acf90004
commit aed7a4fccf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -132,7 +132,8 @@ function ogp_load_english_fallbacks()
function ogp_include_lang_file_safely($filePath)
{
set_error_handler(function ($severity, $message) {
if ($severity === E_WARNING && strpos($message, 'already defined') !== false) {
$isConstantRedefinition = (bool)preg_match('/^Constant\\s+.+\\s+already\\s+defined$/i', trim((string)$message));
if ($severity === E_WARNING && $isConstantRedefinition) {
return true;
}
return false;

View file

@ -1134,7 +1134,7 @@ function exec_ogp_module() {
echo "<div id='xml-editor-section'>";
config_games_render_top_level_editor($home_cfg_id, $config_file);
echo "<details style='margin:18px 0'><summary style='cursor:pointer;color:#9dc7ff'>Open legacy detailed node editor</summary>";
echo "<details style='margin:18px 0'><summary style='cursor:pointer;color:#9dc7ff'>Open legacy detailed node editor (previous default editor)</summary>";
echo "<form action='?m=config_games&amp;home_cfg_id=".$home_cfg_id."' method='post'>";
echo "<input type='hidden' name='home_cfg_id' value='".(int)$home_cfg_id."'>";
echo "<button type='submit' name='save_xml' value='1' class='xml-global-save xml-global-save--top'>".get_lang('save')."</button>";