Skip to content

Commit

Permalink
base64 but not urlencode in saving config
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Sep 3, 2020
1 parent 6bf9e7e commit d488547
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 42 deletions.
8 changes: 4 additions & 4 deletions platform/AliyunFC.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
Expand All @@ -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') {
Expand All @@ -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;
}
}
Expand Down
8 changes: 4 additions & 4 deletions platform/BaiduCFC.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
Expand All @@ -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') {
Expand All @@ -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;
}
}
Expand Down
8 changes: 4 additions & 4 deletions platform/Heroku.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
Expand All @@ -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') {
Expand All @@ -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;
}
}
Expand Down
8 changes: 4 additions & 4 deletions platform/HuaweiFG_env.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
Expand All @@ -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') {
Expand All @@ -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;
}
}
Expand Down
8 changes: 4 additions & 4 deletions platform/HuaweiFG_file.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
Expand All @@ -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') {
Expand All @@ -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;
}
}
Expand Down
8 changes: 4 additions & 4 deletions platform/Normal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
Expand All @@ -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') {
Expand All @@ -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;
}
}
Expand Down
8 changes: 4 additions & 4 deletions platform/TencentSCF_env.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
Expand All @@ -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') {
Expand All @@ -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;
}
}
Expand Down
8 changes: 4 additions & 4 deletions platform/TencentSCF_file.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
Expand All @@ -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') {
Expand All @@ -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;
}
}
Expand Down
5 changes: 2 additions & 3 deletions theme/Onedrive-dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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-->
Expand Down
17 changes: 10 additions & 7 deletions theme/classic.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ <h1 class="title" id="title">
<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-->
Expand Down Expand Up @@ -999,12 +999,14 @@ <h3 class="table-header"><a href="<!--base_path-->"><!--constStr@Home--></a><!--
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>';
Expand All @@ -1015,6 +1017,7 @@ <h3 class="table-header"><a href="<!--base_path-->"><!--constStr@Home--></a><!--
}
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;
Expand Down

0 comments on commit d488547

Please sign in to comment.