We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cee040c commit 2eca248Copy full SHA for 2eca248
src/Attachment.php
@@ -81,7 +81,11 @@ public function save(string $path): false|int
81
*/
82
public function extension(): ?string
83
{
84
- if ($ext = pathinfo($this->filename ?? '', PATHINFO_EXTENSION)) {
+ if (! $this->filename) {
85
+ return null;
86
+ }
87
+
88
+ if ($ext = pathinfo($this->filename, PATHINFO_EXTENSION)) {
89
return $ext;
90
}
91
0 commit comments