Skip to content

Commit

Permalink
Use only forward slashes in attachment URLs - closes #4106
Browse files Browse the repository at this point in the history
  • Loading branch information
freescout-help-desk committed Jul 5, 2024
1 parent 5ab6a42 commit 9bb3ee9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/Attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9bb3ee9

Please sign in to comment.