From bebe70d28ebc9443f666e4f0035375e80fd60dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 7 Jun 2020 19:25:58 +0200 Subject: [PATCH] Fixed assets path generation on windows (use server path for files where this is possible). --- src/Services/Attachments/AttachmentURLGenerator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Services/Attachments/AttachmentURLGenerator.php b/src/Services/Attachments/AttachmentURLGenerator.php index 4bbefc0c..14bea264 100644 --- a/src/Services/Attachments/AttachmentURLGenerator.php +++ b/src/Services/Attachments/AttachmentURLGenerator.php @@ -87,12 +87,13 @@ class AttachmentURLGenerator */ public function absolutePathToAssetPath(string $absolute_path, ?string $public_path = null): ?string { + //Normalize file path (public path, use / as file path) + $absolute_path = str_replace('\\', '/', $absolute_path); + if (null === $public_path) { $public_path = $this->public_path; } - - //Our absolute path must begin with public path or we can not use it for asset pathes. if (0 !== strpos($absolute_path, $public_path)) { return null;