From c3dea321b9b9260cc202f4c80eb4999e1830dc2d Mon Sep 17 00:00:00 2001 From: Michael Erdely Date: Thu, 10 Oct 2024 00:41:12 -0400 Subject: [PATCH] fix permissions on new image files --- src/item.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/item.php b/src/item.php index ca92347..34d3a48 100644 --- a/src/item.php +++ b/src/item.php @@ -106,6 +106,8 @@ if (!empty($_REQUEST["action"])) { error_log("MWE: image_filename: $image_filename"); // move the PHP temporary file to that filename. rename($temp_image, $image_filename); + // fix permissions on the new file + chmod($image_filename, 0644); // the name we're going to record in the DB is the filename without the path. $image_base_filename = basename($image_filename); error_log("MWE: image_base_filename: $image_base_filename"); @@ -166,6 +168,8 @@ if (!empty($_REQUEST["action"])) { $image_filename = $temp_name . "." . $uploaded_file_ext; // move the PHP temporary file to that filename. move_uploaded_file($_FILES["imagefile"]["tmp_name"],$image_filename); + // fix permissions on the new file + chmod($image_filename, 0644); // the name we're going to record in the DB is the filename without the path. $image_base_filename = basename($image_filename); }