Skip to content

Commit

Permalink
修复使用原文件名规则时返回了错误链接的 bug.(Fixed #496)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xxb committed Aug 5, 2022
1 parent a4a60f1 commit 768ca9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Services/ImageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ protected function replacePathname(string $pathname, UploadedFile $file): string
'{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);
Expand Down

0 comments on commit 768ca9f

Please sign in to comment.