mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-05 15:05:58 +01:00
Fixed assets path generation on windows (use server path for files where this is possible).
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user