diff --git a/platform/HuaweiFG_file.php b/platform/HuaweiFG_file.php index 5fa69da..0995c45 100644 --- a/platform/HuaweiFG_file.php +++ b/platform/HuaweiFG_file.php @@ -73,7 +73,8 @@ function getConfig($str, $disktag = '') global $Base64Env; //include 'config.php'; $s = file_get_contents(__DIR__ . '/../config.php'); - $configs = substr($s, 18, -2); + //$configs = substr($s, 18, -2); + $configs = '{' . splitlast(splitfirst($s, '{')[1], '}')[0] . '}'; if ($configs!='') { $envs = json_decode($configs, true); if (in_array($str, $InnerEnv)) { @@ -99,7 +100,8 @@ function setConfig($arr, $disktag = '') if ($disktag=='') $disktag = $_SERVER['disktag']; //include 'config.php'; $s = file_get_contents(__DIR__ . '/../config.php'); - $configs = substr($s, 18, -2); + //$configs = substr($s, 18, -2); + $configs = '{' . splitlast(splitfirst($s, '{')[1], '}')[0] . '}'; if ($configs!='') $envs = json_decode($configs, true); $disktags = explode("|",getConfig('disktag')); $indisk = 0; @@ -380,10 +382,8 @@ function updateEnvironment($Envs, $HW_urn, $HW_key, $HW_secret) copyFolder($coderoot, $outPath); // 将配置写入 - $prestr = ' $v) { $tmp_env[$k] = $v;