Просмотр исходного кода

TS3 replacement fix

If the whitelist is empty it finds an ocurrence with ^$, so it uses the replacement code at line 247:
$file_content = preg_replace("/$default/m", "$var$info_param", $file_content, 1);
Which has no newline character.
Once the first IP is placed to the whitelist, if the user starts the server by accessing to the panel from another IP, this regex does not match, so it uses the replacement at line 181:
$file_content .= "\n$var$info_param";
Which adds a new line before the new IP.
DieFeM 8 лет назад
Родитель
Сommit
4e093b6ffb

+ 1 - 0
modules/config_games/server_configs/teamspeak3_linux32.xml

@@ -22,6 +22,7 @@
   </mods>
   <replace_texts>
     <text key="webhost_ip">
+      <default>^$</default>
       <filepath>teamspeak3-server_linux_x86/query_ip_whitelist.txt</filepath>
     </text>
   </replace_texts>

+ 1 - 0
modules/config_games/server_configs/teamspeak3_linux64.xml

@@ -22,6 +22,7 @@
   </mods>
   <replace_texts>
     <text key="webhost_ip">
+      <default>^$</default>
       <filepath>teamspeak3-server_linux_amd64/query_ip_whitelist.txt</filepath>
     </text>
   </replace_texts>

+ 1 - 0
modules/config_games/server_configs/teamspeak3_win32.xml

@@ -22,6 +22,7 @@
   </mods>
   <replace_texts>
     <text key="webhost_ip">
+      <default>^$</default>
       <filepath>teamspeak3-server_win32/query_ip_whitelist.txt</filepath>
     </text>
   </replace_texts>

+ 1 - 0
modules/config_games/server_configs/teamspeak3_win64.xml

@@ -22,6 +22,7 @@
   </mods>
   <replace_texts>
     <text key="webhost_ip">
+      <default>^$</default>
       <filepath>teamspeak3-server_win64/query_ip_whitelist.txt</filepath>
     </text>
   </replace_texts>