From 529b141f1b3d69c784676c8d4af6b500efa4380d Mon Sep 17 00:00:00 2001 From: FreeScout Date: Wed, 15 Nov 2023 21:16:46 -0800 Subject: [PATCH] Fix URLs for attachments with percents - closes #3530 --- app/Attachment.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Attachment.php b/app/Attachment.php index 30463c6a4..61773f52c 100644 --- a/app/Attachment.php +++ b/app/Attachment.php @@ -248,7 +248,13 @@ public static function typeNameToInt($type_name) */ public function url() { - return Storage::url($this->getStorageFilePath()).'?id='.$this->id.'&token='.$this->getToken(); + $file_url = Storage::url($this->getStorageFilePath()); + + // Fix percents. + // https://github.com/freescout-helpdesk/freescout/issues/3530 + $file_url = str_replace('%', '%25', $file_url); + + return $file_url.'?id='.$this->id.'&token='.$this->getToken(); } /**