Skip to content

Commit

Permalink
add UTF8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Playit3110 committed Feb 16, 2022
1 parent d74682a commit 801abb5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion system/JS/nav.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const Explorer = {
this.path += dir + "/";
}
}
this.path = decodeURI(this.path);

let paths = await request({
data: {
Expand Down Expand Up @@ -59,7 +60,8 @@ const Explorer = {
elem.onblur = function() {
elem.removeAttribute("contenteditable");
let newName = elem.innerText;
newName = newName.replace(/[^a-zA-Z0-9_\[\]\.]/g, "");
newName = newName.replace(/[ ]/g, "_");
newName = newName.replace(/[^a-zA-Z0-9_\[\]\.\-]/g, "");
if(oldName == newName) return;
if(action == false && !confirm("Do you really want to rename \""+oldName+"\" to \""+newName+"\"?")) return;
let div = elem.parentNode;
Expand Down
3 changes: 2 additions & 1 deletion system/PHP/download.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ function download($path) {
} else if(is_dir($path)) {
chdir("$path/../");
$bn = basename($path);
setlocale(LC_CTYPE, "en_US.UTF-8");
if(preg_match('/linux/i', $_SERVER["HTTP_USER_AGENT"])) {
// tar
$compressed = shell_exec("tar -czf - ".escapeshellarg($bn));
// header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"$bn.tar.gz\"");
} else {
// zip
$compressed = shell_exec("zip -r - ".escapeshellarg($bn)." | cat");
$compressed = shell_exec("zip -qr - ".escapeshellarg($bn)." | cat");
// header("Content-Type: application/octet-stream");
// header("Content-Type: application/zip");
header("Content-Disposition: attachment; filename=\"$bn.zip\"");
Expand Down

0 comments on commit 801abb5

Please sign in to comment.