From bdf52d0191241222fa1bcbff6ab6fa1ca651447f Mon Sep 17 00:00:00 2001 From: Jenga Phoenix Date: Sat, 26 Jan 2019 23:55:01 -0600 Subject: [PATCH] Added EXIF data-stripping for JPEG files --- public_html/private/beam.php | 7 +++++++ resources/{config.default.php => config.example.php} | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) rename resources/{config.default.php => config.example.php} (95%) diff --git a/public_html/private/beam.php b/public_html/private/beam.php index 6a037c8..f8eb03e 100644 --- a/public_html/private/beam.php +++ b/public_html/private/beam.php @@ -21,12 +21,19 @@ switch (true) { case (empty($file_name) || empty($dest_name)): redirect(make_url("result/beam.php?error=1")); break; + case (file_exists($dest_file)): redirect(make_url("result/beam.php?error=2")); break; + case (move_uploaded_file($_FILES["uploadcoin"]["tmp_name"], $dest_file) && write_metadata($dest_file, $_POST["file_source"])): + + if (in_array(file_extension($dest_file)),array("jpg","jpeg")) { + sanitize_image($dest_file); + } + redirect(make_url("result/beam.php?success=" . $file_name)); break; diff --git a/resources/config.default.php b/resources/config.example.php similarity index 95% rename from resources/config.default.php rename to resources/config.example.php index 4d34a3b..d40c584 100644 --- a/resources/config.default.php +++ b/resources/config.example.php @@ -41,7 +41,7 @@ $file_beam_dir = "p/"; // where the files go // for sanitization of images (stripping EXIF, etc) with an external program. -$image_sanitize_command = "mogrify"; -$image_sanitize_args = "strip"; +$image_sanitize_command = "jhead"; +$image_sanitize_args = "-purejpg"; ?>