base64 but not urlencode in saving config

pull/128/head v2.5
root 2020-09-03 11:27:21 +08:00
parent 6bf9e7e843
commit d48854791f
10 changed files with 44 additions and 42 deletions

View File

@ -59,11 +59,11 @@ function getConfig($str, $disktag = '')
if ($disktag=='') $disktag = $_SERVER['disktag'];
$env = json_decode(getenv($disktag), true);
if (isset($env[$str])) {
if (in_array($str, $Base64Env)) return equal_replace($env[$str],1);
if (in_array($str, $Base64Env)) return base64y_decode($env[$str]);
else return $env[$str];
}
} else {
if (in_array($str, $Base64Env)) return equal_replace(getenv($str),1);
if (in_array($str, $Base64Env)) return base64y_decode(getenv($str));
else return getenv($str);
}
return '';
@ -81,7 +81,7 @@ function setConfig($arr, $disktag = '')
$oparetdisk = 0;
foreach ($arr as $k => $v) {
if (in_array($k, $InnerEnv)) {
if (in_array($k, $Base64Env)) $diskconfig[$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $diskconfig[$k] = base64y_encode($v);
else $diskconfig[$k] = $v;
$indisk = 1;
} elseif ($k=='disktag_add') {
@ -92,7 +92,7 @@ function setConfig($arr, $disktag = '')
$tmp[$v] = '';
$oparetdisk = 1;
} else {
if (in_array($k, $Base64Env)) $tmp[$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $tmp[$k] = base64y_encode($v);
else $tmp[$k] = $v;
}
}

View File

@ -53,11 +53,11 @@ function getConfig($str, $disktag = '')
if ($disktag=='') $disktag = $_SERVER['disktag'];
$env = json_decode(getenv($disktag), true);
if (isset($env[$str])) {
if (in_array($str, $Base64Env)) return equal_replace($env[$str],1);
if (in_array($str, $Base64Env)) return base64y_decode($env[$str]);
else return $env[$str];
}
} else {
if (in_array($str, $Base64Env)) return equal_replace(getenv($str),1);
if (in_array($str, $Base64Env)) return base64y_decode(getenv($str));
else return getenv($str);
}
return '';
@ -75,7 +75,7 @@ function setConfig($arr, $disktag = '')
$oparetdisk = 0;
foreach ($arr as $k => $v) {
if (in_array($k, $InnerEnv)) {
if (in_array($k, $Base64Env)) $diskconfig[$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $diskconfig[$k] = base64y_encode($v);
else $diskconfig[$k] = $v;
$indisk = 1;
} elseif ($k=='disktag_add') {
@ -86,7 +86,7 @@ function setConfig($arr, $disktag = '')
$tmp[$v] = '';
$oparetdisk = 1;
} else {
if (in_array($k, $Base64Env)) $tmp[$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $tmp[$k] = base64y_encode($v);
else $tmp[$k] = $v;
}
}

View File

@ -46,11 +46,11 @@ function getConfig($str, $disktag = '')
if ($disktag=='') $disktag = $_SERVER['disktag'];
$env = json_decode(getenv($disktag), true);
if (isset($env[$str])) {
if (in_array($str, $Base64Env)) return equal_replace($env[$str],1);
if (in_array($str, $Base64Env)) return base64y_decode($env[$str]);
else return $env[$str];
}
} else {
if (in_array($str, $Base64Env)) return equal_replace(getenv($str),1);
if (in_array($str, $Base64Env)) return base64y_decode(getenv($str));
else return getenv($str);
}
return '';
@ -68,7 +68,7 @@ function setConfig($arr, $disktag = '')
$oparetdisk = 0;
foreach ($arr as $k => $v) {
if (in_array($k, $InnerEnv)) {
if (in_array($k, $Base64Env)) $diskconfig[$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $diskconfig[$k] = base64y_encode($v);
else $diskconfig[$k] = $v;
$indisk = 1;
} elseif ($k=='disktag_add') {
@ -79,7 +79,7 @@ function setConfig($arr, $disktag = '')
$tmp[$v] = '';
$oparetdisk = 1;
} else {
if (in_array($k, $Base64Env)) $tmp[$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $tmp[$k] = base64y_encode($v);
else $tmp[$k] = $v;
}
}

View File

@ -76,11 +76,11 @@ function getConfig($str, $disktag = '')
if ($disktag=='') $disktag = $_SERVER['disktag'];
$env = json_decode($contextUserData->getUserData($disktag), true);
if (isset($env[$str])) {
if (in_array($str, $Base64Env)) return equal_replace($env[$str],1);
if (in_array($str, $Base64Env)) return base64y_decode($env[$str]);
else return $env[$str];
}
} else {
if (in_array($str, $Base64Env)) return equal_replace($contextUserData->getUserData($str),1);
if (in_array($str, $Base64Env)) return base64y_decode($contextUserData->getUserData($str));
else return $contextUserData->getUserData($str);
}
return '';
@ -99,7 +99,7 @@ function setConfig($arr, $disktag = '')
$oparetdisk = 0;
foreach ($arr as $k => $v) {
if (in_array($k, $InnerEnv)) {
if (in_array($k, $Base64Env)) $diskconfig[$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $diskconfig[$k] = base64y_encode($v);
else $diskconfig[$k] = $v;
$indisk = 1;
} elseif ($k=='disktag_add') {
@ -110,7 +110,7 @@ function setConfig($arr, $disktag = '')
$tmp[$v] = '';
$oparetdisk = 1;
} else {
if (in_array($k, $Base64Env)) $tmp[$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $tmp[$k] = base64y_encode($v);
else $tmp[$k] = $v;
}
}

View File

@ -80,12 +80,12 @@ function getConfig($str, $disktag = '')
if (in_array($str, $InnerEnv)) {
if ($disktag=='') $disktag = $_SERVER['disktag'];
if (isset($envs[$disktag][$str])) {
if (in_array($str, $Base64Env)) return equal_replace($envs[$disktag][$str],1);
if (in_array($str, $Base64Env)) return base64y_decode($envs[$disktag][$str]);
else return $envs[$disktag][$str];
}
} else {
if (isset($envs[$str])) {
if (in_array($str, $Base64Env)) return equal_replace($envs[$str],1);
if (in_array($str, $Base64Env)) return base64y_decode($envs[$str]);
else return $envs[$str];
}
}
@ -108,7 +108,7 @@ function setConfig($arr, $disktag = '')
$operatedisk = 0;
foreach ($arr as $k => $v) {
if (in_array($k, $InnerEnv)) {
if (in_array($k, $Base64Env)) $envs[$disktag][$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $envs[$disktag][$k] = base64y_encode($v);
else $envs[$disktag][$k] = $v;
$indisk = 1;
} elseif ($k=='disktag_add') {
@ -119,7 +119,7 @@ function setConfig($arr, $disktag = '')
$envs[$v] = '';
$operatedisk = 1;
} else {
if (in_array($k, $Base64Env)) $envs[$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $envs[$k] = base64y_encode($v);
else $envs[$k] = $v;
}
}

View File

@ -54,12 +54,12 @@ function getConfig($str, $disktag = '')
if (in_array($str, $InnerEnv)) {
if ($disktag=='') $disktag = $_SERVER['disktag'];
if (isset($envs[$disktag][$str])) {
if (in_array($str, $Base64Env)) return equal_replace($envs[$disktag][$str],1);
if (in_array($str, $Base64Env)) return base64y_decode($envs[$disktag][$str]);
else return $envs[$disktag][$str];
}
} else {
if (isset($envs[$str])) {
if (in_array($str, $Base64Env)) return equal_replace($envs[$str],1);
if (in_array($str, $Base64Env)) return base64y_decode($envs[$str]);
else return $envs[$str];
}
}
@ -82,7 +82,7 @@ function setConfig($arr, $disktag = '')
$operatedisk = 0;
foreach ($arr as $k => $v) {
if (in_array($k, $InnerEnv)) {
if (in_array($k, $Base64Env)) $envs[$disktag][$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $envs[$disktag][$k] = base64y_encode($v);
else $envs[$disktag][$k] = $v;
$indisk = 1;
} elseif ($k=='disktag_add') {
@ -93,7 +93,7 @@ function setConfig($arr, $disktag = '')
$envs[$v] = '';
$operatedisk = 1;
} else {
if (in_array($k, $Base64Env)) $envs[$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $envs[$k] = base64y_encode($v);
else $envs[$k] = $v;
}
}

View File

@ -60,11 +60,11 @@ function getConfig($str, $disktag = '')
if ($disktag=='') $disktag = $_SERVER['disktag'];
$env = json_decode(getenv($disktag), true);
if (isset($env[$str])) {
if (in_array($str, $Base64Env)) return equal_replace($env[$str],1);
if (in_array($str, $Base64Env)) return base64y_decode($env[$str]);
else return $env[$str];
}
} else {
if (in_array($str, $Base64Env)) return equal_replace(getenv($str),1);
if (in_array($str, $Base64Env)) return base64y_decode(getenv($str));
else return getenv($str);
}
return '';
@ -82,7 +82,7 @@ function setConfig($arr, $disktag = '')
$oparetdisk = 0;
foreach ($arr as $k => $v) {
if (in_array($k, $InnerEnv)) {
if (in_array($k, $Base64Env)) $diskconfig[$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $diskconfig[$k] = base64y_encode($v);
else $diskconfig[$k] = $v;
$indisk = 1;
} elseif ($k=='disktag_add') {
@ -93,7 +93,7 @@ function setConfig($arr, $disktag = '')
$tmp[$v] = '';
$oparetdisk = 1;
} else {
if (in_array($k, $Base64Env)) $tmp[$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $tmp[$k] = base64y_encode($v);
else $tmp[$k] = $v;
}
}

View File

@ -65,12 +65,12 @@ function getConfig($str, $disktag = '')
if (in_array($str, $InnerEnv)) {
if ($disktag=='') $disktag = $_SERVER['disktag'];
if (isset($envs[$disktag][$str])) {
if (in_array($str, $Base64Env)) return equal_replace($envs[$disktag][$str],1);
if (in_array($str, $Base64Env)) return base64y_decode($envs[$disktag][$str]);
else return $envs[$disktag][$str];
}
} else {
if (isset($envs[$str])) {
if (in_array($str, $Base64Env)) return equal_replace($envs[$str],1);
if (in_array($str, $Base64Env)) return base64y_decode($envs[$str]);
else return $envs[$str];
}
}
@ -93,7 +93,7 @@ function setConfig($arr, $disktag = '')
$operatedisk = 0;
foreach ($arr as $k => $v) {
if (in_array($k, $InnerEnv)) {
if (in_array($k, $Base64Env)) $envs[$disktag][$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $envs[$disktag][$k] = base64y_encode($v);
else $envs[$disktag][$k] = $v;
$indisk = 1;
} elseif ($k=='disktag_add') {
@ -104,7 +104,7 @@ function setConfig($arr, $disktag = '')
$envs[$v] = '';
$operatedisk = 1;
} else {
if (in_array($k, $Base64Env)) $envs[$k] = equal_replace($v);
if (in_array($k, $Base64Env)) $envs[$k] = base64y_encode($v);
else $envs[$k] = $v;
}
}

View File

@ -227,7 +227,6 @@
main .main-item-list .main-items-fileName a:hover {
text-decoration: underline;
}
.main-title-path a{vertical-align: middle;}
.more-disk{
vertical-align: middle;
overflow: hidden;
@ -293,10 +292,10 @@
<div class="main-title">
<h1 class="main-title-path">
<a href="<!--base_path-->"><!--constStr@Home--></a>
<!--PathArrayStart-->
<!--DiskPathArrayStart-->
>
<a href="<!--PathArrayLink-->"><!--PathArrayName--></a>
<!--PathArrayEnd-->
<!--DiskPathArrayEnd-->
</h1>
</div>
<!--IsFileStart-->

View File

@ -149,7 +149,7 @@
<div class="list-wrapper" id="list-div">
<div class="list-container">
<div class="list-header-container">
<h3 class="table-header"><a href="<!--base_path-->"><!--constStr@Home--></a><!--PathArrayStart--> / <a href="<!--PathArrayLink-->"><!--PathArrayName--></a><!--PathArrayEnd--></h3>
<h3 class="table-header"><a href="<!--base_path-->"><!--constStr@Home--></a><!--DiskPathArrayStart--> / <a href="<!--PathArrayLink-->"><!--PathArrayName--></a><!--DiskPathArrayEnd--></h3>
</div>
<div class="list-body-container">
<!--EncryptedStart-->
@ -999,12 +999,14 @@
var response=JSON.parse(xhr.responseText);
if (response['size']>0) {
// contain size, upload finish. 有size说明是最终返回上传结束
var xhr3 = new XMLHttpRequest();
xhr3.open("GET", '?action=del_upload_cache&filelastModified='+file.lastModified+'&filesize='+file.size+'&filename='+filename);
xhr3.setRequestHeader('x-requested-with','XMLHttpRequest');
xhr3.send(null);
xhr3.onload = function(e){
console.log(xhr3.responseText+','+xhr3.status);
if (totalsize>10*1024*1024) {
var xhr3 = new XMLHttpRequest();
xhr3.open("GET", '?action=del_upload_cache&filelastModified='+file.lastModified+'&filesize='+file.size+'&filename='+filename);
xhr3.setRequestHeader('x-requested-with','XMLHttpRequest');
xhr3.send(null);
xhr3.onload = function(e){
console.log(xhr3.responseText+','+xhr3.status);
}
}
EndTime=new Date();
MiddleStr = '<!--constStr@EndAt-->:'+EndTime.toLocaleString()+'<br>';
@ -1015,6 +1017,7 @@
}
document.getElementById('upfile_td1_'+tdnum).innerHTML='<div style="color:green"><a href="<!--base_disk_path--><!--Path-->'+(file.webkitRelativePath||response.name)+'?preview" id="upfile_a_'+tdnum+'" target="_blank">'+document.getElementById('upfile_td1_'+tdnum).innerHTML+'</a><br><a href="<!--base_disk_path--><!--Path-->'+(file.webkitRelativePath||response.name)+'" id="upfile_a1_'+tdnum+'"></a><!--constStr@UploadComplete--><button onclick="CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');" id="upfile_cpbt_'+tdnum+'" <!--AdminStart--> style="display:none"<!--AdminEnd--> ><!--constStr@CopyUrl--></button></div>';
label.innerHTML=StartStr+MiddleStr;
label.style.color='green';
// uploadbuttonshow();
<!--AdminStart-->
response.name=file.webkitRelativePath||response.name;