fix: wrap DayZ post_install scripts in CDATA, add XML editor auto-sanitizer

- dayz_arma2co_win32.xml: wrap post_install in CDATA to fix raw '<' breaking
  XML parsing; fix dbPass generation to use portable tr form
- dayz_epoch_mod_win32.xml: same CDATA wrapping; replace &lt; literals so
  bash actually receives real '<' redirect characters
- config_servers.php: add config_games_sanitize_xml_scripts() that wraps bare
  '<' in script-like nodes with CDATA before saving raw XML; add
  config_games_script_node_names() helper; structured-editor save now uses
  createCDATASection() for post_install/pre_start/etc. nodes so shell
  characters survive DOM round-trips intact

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/1afce49e-510d-49a6-9d11-0b7118d3cf85

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

View file

@ -65,7 +65,7 @@ Make sure if you install a MOD, you list the name here or else it wont get loade
</param>
</server_params>
<post_install>
<post_install><![CDATA[
mkdir -p ./cfg
touch ./cfg/dayz_arma2co_win32.xml.txt
@ -81,7 +81,7 @@ rm -f dayzmod1.9.0.tar
#Create Database ---------------------------------------
dbPass=$(</dev/urandom tr -dc 'A-Za-z0-9_' | head -c 12)
dbPass=$(tr -dc 'A-Za-z0-9_' </dev/urandom | head -c 12)
srvID=${PWD##*/}
dbID="server_${srvID}"
@ -105,8 +105,6 @@ VALUES (1, ${srvID}, '${dbID}', '${dbPass}', '${dbID}', 1);
mysql --force "${dbID}" < 1.9.0_fresh.sql
# Create alsoRun.bat -----------------------------------
printf '%s\r\n' \
@ -119,8 +117,7 @@ printf '%s\r\n' \
'for /f "tokens=2 delims==" %%P in ('"'"'wmic process where "ExecutablePath='"'"'%cd:\=\\%\\bec.exe'"'"'" get ProcessId /value ^| find "="'"'"') do >"..\_alsoRun.pid" echo %%P' \
> _alsoRun.bat
</post_install>
]]></post_install>
<pre_start>
</pre_start>

View file

@ -65,7 +65,7 @@ Make sure if you install a MOD, you list the name here or else it wont get loade
</param>
</server_params>
<post_install>
<post_install><![CDATA[
mkdir -p ./cfg
touch ./cfg/epochmod_win32.xml
@ -81,7 +81,7 @@ rm -f epochmod.tar
#Create Database ---------------------------------------
dbPass=$(&lt;/dev/urandom tr -dc 'A-Za-z0-9_' | head -c 12)
dbPass=$(tr -dc 'A-Za-z0-9_' </dev/urandom | head -c 12)
srvID=${PWD##*/}
dbID="server_${srvID}"
@ -102,9 +102,7 @@ INSERT INTO panel.gsp_mysql_databases
VALUES (1, ${srvID}, '${dbID}', '${dbPass}', '${dbID}', 1);
"
mysql --force "${dbID}" &lt; 1.9.0_fresh.sql
mysql --force "${dbID}" < 1.9.0_fresh.sql
# Create _alsoRun.bat -----------------------------------
@ -119,8 +117,7 @@ printf '%s\r\n' \
'for /f "tokens=2 delims==" %%P in ('"'"'wmic process where "ExecutablePath='"'"'%cd:\=\\%\\bec.exe'"'"'" get ProcessId /value ^| find "="'"'"') do >"..\_alsoRun.pid" echo %%P' \
> _alsoRun.bat
</post_install>
]]></post_install>
<pre_start>
</pre_start>