修复使用原文件名规则时返回了错误链接的 bug.(Fixed #496)

This commit is contained in:
Wisp X 2022-08-05 17:35:10 +08:00
parent a4a60f13a0
commit 768ca9f24a

View File

@ -618,7 +618,7 @@ class ImageService
'{md5-16}' => substr(md5(microtime().Str::random()), 0, 16),
'{str-random-16}' => Str::random(),
'{str-random-10}' => Str::random(10),
'{filename}' => rtrim($file->getClientOriginalName(), '.'.$file->getClientOriginalExtension()),
'{filename}' => Str::replaceLast('.'.$file->getClientOriginalExtension(), '', $file->getClientOriginalName()),
'{uid}' => Auth::check() ? Auth::id() : 0,
];
return str_replace(array_keys($array), array_values($array), $pathname);