From 9bb3ee9bc10c72d5319220df01fda27dc6ee2708 Mon Sep 17 00:00:00 2001 From: FreeScout Date: Thu, 4 Jul 2024 21:04:52 -0700 Subject: [PATCH] Use only forward slashes in attachment URLs - closes #4106 --- app/Attachment.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Attachment.php b/app/Attachment.php index 97a64a9e6..d469140d5 100644 --- a/app/Attachment.php +++ b/app/Attachment.php @@ -252,7 +252,12 @@ public static function typeNameToInt($type_name) */ public function url() { - $file_url = Storage::url($this->getStorageFilePath()); + $file_path = $this->getStorageFilePath(); + + // URL must contain only forward slashes. + $file_path = str_replace(DIRECTORY_SEPARATOR, '/', $file_path); + + $file_url = Storage::url($file_path); // Fix percents. // https://github.com/freescout-helpdesk/freescout/issues/3530