From 9c6cf6fdb622db07332d0c23f1ba47b123005670 Mon Sep 17 00:00:00 2001 From: Libor M Date: Sat, 17 Oct 2020 15:56:40 +0200 Subject: [PATCH] PHP 8.0 fix - ValueError: file_exists(): Argument #1 ($filename) must not contain any null bytes --- src/PhpWord/Element/Image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/Element/Image.php b/src/PhpWord/Element/Image.php index bae87ff5..c6dd0e58 100644 --- a/src/PhpWord/Element/Image.php +++ b/src/PhpWord/Element/Image.php @@ -454,7 +454,7 @@ class Image extends AbstractElement } else { $this->sourceType = self::SOURCE_GD; } - } elseif (@file_exists($this->source)) { + } elseif (is_string($this->source) && @file_exists($this->source)) { $this->memoryImage = false; $this->sourceType = self::SOURCE_LOCAL; } else {