From e3fb67661eb1f21fc2fa1f1d629a4b1a709aa087 Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 1 Jan 2024 00:53:46 +0000 Subject: [PATCH] nits --- .devcontainer/devcontainer.json | 3 ++- ext/upload/script.js | 2 +- ext/upload/theme.php | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 43bbf0a1..968d7a84 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -21,7 +21,8 @@ "postCreateCommand": "./.docker/entrypoint.sh unitd --no-daemon --control unix:/var/run/control.unit.sock", "containerEnv": { "UID": "2000", - "GID": "2000" + "GID": "2000", + "UPLOAD_MAX_FILESIZE": "50M", }, "customizations": { "vscode": { diff --git a/ext/upload/script.js b/ext/upload/script.js index 14eef320..cae83678 100644 --- a/ext/upload/script.js +++ b/ext/upload/script.js @@ -15,7 +15,7 @@ function updateTracker() { if (input.files.length) { if(cancelbtn) cancelbtn.style.visibility = 'visible'; for (var i = 0; i < input.files.length; i++) { - size += input.files[i].size; + size += input.files[i].size + 1024; // extra buffer for metadata if (window.shm_max_size > 0 && input.files[i].size > window.shm_max_size) { toobig = true; } diff --git a/ext/upload/theme.php b/ext/upload/theme.php index 7c9f1c4d..728b048c 100644 --- a/ext/upload/theme.php +++ b/ext/upload/theme.php @@ -42,7 +42,7 @@ class UploadTheme extends Themelet $tl_enabled = ($config->get_string(UploadConfig::TRANSLOAD_ENGINE, "none") != "none"); $max_size = $config->get_int(UploadConfig::SIZE); $max_kb = to_shorthand_int($max_size); - $max_total_size = parse_shorthand_int(ini_get('post_max_size')) - 102400; //leave room for http request data + $max_total_size = parse_shorthand_int(ini_get('post_max_size')); $max_total_kb = to_shorthand_int($max_total_size); $upload_list = $this->build_upload_list(); @@ -172,7 +172,7 @@ class UploadTheme extends Themelet '; $html2 = P( A(["href" => $js], $title), - rawHTML("(Click when looking at a post page. Works on sites running Shimmie / Danbooru / Gelbooru. (This also grabs the tags / rating / source!))"), + rawHTML(" (Click when looking at a post page. Works on sites running Shimmie / Danbooru / Gelbooru. (This also grabs the tags / rating / source!))"), ); return emptyHTML($html1, $html2);