From d20211fad9bc61b9e92c70707ecbe2a5a30fe75a Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 4 May 2025 17:08:41 +0500 Subject: upd: use imagemagick cli for resizing images --- public/emotes/upload.php | 45 +++++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 28 deletions(-) (limited to 'public') diff --git a/public/emotes/upload.php b/public/emotes/upload.php index 89abf44..de4d2d4 100644 --- a/public/emotes/upload.php +++ b/public/emotes/upload.php @@ -23,7 +23,7 @@ if (isset($_SESSION["user_role"]) && $_SESSION["user_role"]["permission_upload"] $uploader_name = $_SESSION["user_name"] ?? ANONYMOUS_DEFAULT_NAME; } -function abort_upload(string $path, PDO $db, string $id, string $response_text, int $response_code = 400) +function abort_upload(string $path, PDO $db, string $id) { $stmt = $db->prepare("DELETE FROM emotes WHERE id = ?"); $stmt->execute([$id]); @@ -31,8 +31,6 @@ function abort_upload(string $path, PDO $db, string $id, string $response_text, array_map("unlink", glob("$path/*.*")); rmdir($path); - http_response_code($response_code); - exit($response_text); } include "../../src/utils.php"; @@ -59,6 +57,7 @@ if ($_SERVER['REQUEST_METHOD'] != "POST") {
+