Skip to content

Commit f259baf

Browse files
committed
FileUpload: file_info can return false [Closes #145]
1 parent d5cd5e8 commit f259baf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Http/FileUpload.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class FileUpload
3131
/** @var string */
3232
private $name;
3333

34-
/** @var string */
34+
/** @var string|null|false */
3535
private $type;
3636

3737
/** @var int */
@@ -85,7 +85,7 @@ public function getContentType(): ?string
8585
if ($this->isOk() && $this->type === null) {
8686
$this->type = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $this->tmpName);
8787
}
88-
return $this->type;
88+
return $this->type ?: null;
8989
}
9090

9191

0 commit comments

Comments
 (0)