Skip to content

Commit 5ace0d7

Browse files
committed
Prevent from "PHP Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string"
1 parent 21407d4 commit 5ace0d7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Mail/mime.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,9 @@ public function isMultipart()
483483
protected function file2str($file_name)
484484
{
485485
// Check state of file and raise an error properly
486+
if (!is_string($file_name)) {
487+
return self::raiseError('Invalid or empty file name');
488+
}
486489
if (!file_exists($file_name)) {
487490
return self::raiseError('File not found: ' . $file_name);
488491
}

0 commit comments

Comments
 (0)