From 20cecd34a254b5a4338399be0b803ff7037e4242 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Fri, 4 Nov 2022 16:51:49 +0800 Subject: [PATCH] fix(web/image_hosting): hash suffix --- web/app/controllers/image_hosting/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app/controllers/image_hosting/index.php b/web/app/controllers/image_hosting/index.php index e69b84f..0cbea6d 100644 --- a/web/app/controllers/image_hosting/index.php +++ b/web/app/controllers/image_hosting/index.php @@ -51,7 +51,7 @@ } list($width, $height, $type) = $size; - $hash = hash_file("sha256", $_FILES['image_upload_file']['tmp_name']); + $hash = hash_file("sha256", $_FILES['image_upload_file']['tmp_name']) . Auth::id(); $scale = ceil($height / 600.0); $watermark_text = UOJConfig::$data['profile']['oj-name-short']; @@ -60,7 +60,7 @@ $hash .= "__no_watermark"; } elseif ($_POST['watermark'] == 'site_shortname_and_username') { $watermark_text .= ' @'.Auth::id(); - $hash .= "__id_".Auth::id(); + $hash .= "__id"; } $existing_image = DB::selectFirst("SELECT * FROM users_images WHERE `hash` = '$hash'");