Skip to content

Commit

Permalink
Prevent from "PHP Deprecated: file_exists(): Passing null to parameter
Browse files Browse the repository at this point in the history
…#1 ($filename) of type string"
  • Loading branch information
alecpl committed Dec 10, 2023
1 parent 21407d4 commit 5ace0d7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Mail/mime.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@ public function isMultipart()
protected function file2str($file_name)
{
// Check state of file and raise an error properly
if (!is_string($file_name)) {
return self::raiseError('Invalid or empty file name');
}
if (!file_exists($file_name)) {
return self::raiseError('File not found: ' . $file_name);
}
Expand Down

0 comments on commit 5ace0d7

Please sign in to comment.