Kaynağa Gözat

Minor Adjustments to User Path Custom Control

own3mall 8 yıl önce
ebeveyn
işleme
ddf50cf251
1 değiştirilmiş dosya ile 12 ekleme ve 5 silme
  1. 12 5
      modules/gamemanager/mini_start.php

+ 12 - 5
modules/gamemanager/mini_start.php

@@ -29,9 +29,9 @@ $last_param = json_decode($server_home['last_param'], True);
 $isAdmin = $db->isAdmin($_SESSION['user_id']);
 
 if (!function_exists('processParamValue')) {
-	function processParamValue($paramKey, $paramValue){
+	function processParamValue($paramKey, $paramValue, &$save_param, &$start_cmd){
 		// Set globals
-		global $save_param, $start_cmd, $param, $server_xml;
+		global $param, $server_xml;
 		
 		if (0 == strlen($paramValue))
 			return false;
@@ -468,7 +468,14 @@ elseif($server_home['home_id'] == $_POST['home_id'])
 						$dependsKey = str_replace("{DEPENDS:", "", $dependsSection);
 						$dependsKey = str_replace("}", "", $dependsKey);
 						if(hasValue($_REQUEST['params'][$dependsKey])){
-							$paramValue .= $_REQUEST['params'][$dependsKey];
+							$additionalValue = $_REQUEST['params'][$dependsKey];
+							
+							// Remove leading slashes if there are any for additional game path
+							if($dependsKey == "other_game_server_path_additional"){
+								$additionalValue = ltrim($additionalValue,'/');
+							}
+							
+							$paramValue .= $additionalValue;
 						}
 						$paramKey = $realKey;
 					}
@@ -486,7 +493,7 @@ elseif($server_home['home_id'] == $_POST['home_id'])
 						}
 						
 						// Process the param value for the start command and for the save params
-						processParamValue($paramKey, $paramValue);
+						processParamValue($paramKey, $paramValue, $save_param, $start_cmd);
 						
 						$found++;
 						break; // More efficient
@@ -495,7 +502,7 @@ elseif($server_home['home_id'] == $_POST['home_id'])
 				
 				// If the parameter wasn't posted (because it may have been disabled due to access param) or a sneaky user deleted it to circumvent security
 				if($found == 0 && !empty($origValue)){
-					processParamValue((string)$param['key'], $origValue);
+					processParamValue((string)$param['key'], $origValue, $save_param, $start_cmd);
 				}
 				
 				if ($param['id'] != NULL && $param['id'] != ""){