Skip to content

Commit

Permalink
Merge pull request #217 from wivaku/patch-1
Browse files Browse the repository at this point in the history
check if filename has extension
  • Loading branch information
pxlrbt authored Feb 5, 2025
2 parents c054128 + 9802b0d commit 2c67b53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Exports/Concerns/WithFilename.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ abstract protected function getDefaultExtension(): string;

protected function ensureFilenameHasExtension(string $filename): string
{
return Str::contains($filename, '.')
return Str::of($filename)->test('/\.\w{3,4}$/')
? $filename
: $filename.'.'.$this->getDefaultExtension();
}
Expand Down

0 comments on commit 2c67b53

Please sign in to comment.