Skip to content

Commit 9c6cf6f

Browse files
committed
PHP 8.0 fix - ValueError: file_exists(): Argument #1 ($filename) must not contain any null bytes
1 parent 9397821 commit 9c6cf6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PhpWord/Element/Image.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ private function setSourceType()
454454
} else {
455455
$this->sourceType = self::SOURCE_GD;
456456
}
457-
} elseif (@file_exists($this->source)) {
457+
} elseif (is_string($this->source) && @file_exists($this->source)) {
458458
$this->memoryImage = false;
459459
$this->sourceType = self::SOURCE_LOCAL;
460460
} else {

0 commit comments

Comments
 (0)