From 2ad79dc441e4628576f8a7d5b2b0a1e6de1859f2 Mon Sep 17 00:00:00 2001 From: max Date: Sat, 29 Jun 2024 08:53:54 -0400 Subject: [PATCH] Fixing apostrophes and quotes in titles --- public/api/download-selected-images.php | 4 +++- public/api/download-send-email.php | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/public/api/download-selected-images.php b/public/api/download-selected-images.php index 72e68bf..df06382 100755 --- a/public/api/download-selected-images.php +++ b/public/api/download-selected-images.php @@ -89,7 +89,9 @@ if (!is_dir("../tmp/")) { mkdir("../tmp/"); } -$myFile = "../tmp/{$album->getName()} " . date("Y-m-d H-i-s") . ".zip"; +$name = str_replace('"', "", $album->getName()); +$name = str_replace("'", "", $name); +$myFile = "../tmp/$name " . date("Y-m-d H-i-s") . ".zip"; if (count($image_array) > 100) { system("zip -j '$myFile' $images > /dev/null 2>&1 &"); $response ['message'] = "Due to the large number of images, this download will take a while. " . diff --git a/public/api/download-send-email.php b/public/api/download-send-email.php index 388af1f..cbc3e37 100755 --- a/public/api/download-send-email.php +++ b/public/api/download-send-email.php @@ -13,4 +13,6 @@ exit(); } +$file = str_replace('"', "", $file); +$file = str_replace("'", "", $file); system("bash -c 'sleep 300; php -f ../../bin/send-download-email.php $email \"$file\";' > /dev/null 2>&1 &");