From fa84160f7f55a6e28c24cb5b8769518383c09c47 Mon Sep 17 00:00:00 2001 From: neopheus Date: Mon, 12 Sep 2022 13:59:21 +0200 Subject: [PATCH] str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated" --- src/PhpWord/Escaper/Xml.php | 2 +- src/PhpWord/TemplateProcessor.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PhpWord/Escaper/Xml.php b/src/PhpWord/Escaper/Xml.php index 073e297d..316ee85e 100644 --- a/src/PhpWord/Escaper/Xml.php +++ b/src/PhpWord/Escaper/Xml.php @@ -27,6 +27,6 @@ class Xml extends AbstractEscaper protected function escapeSingleValue($input) { // todo: omit encoding parameter after migration onto PHP 5.4 - return (!is_null($input)) ? htmlspecialchars($input, ENT_QUOTES, 'UTF-8') : null; + return (!is_null($input)) ? htmlspecialchars($input, ENT_QUOTES, 'UTF-8') : ''; } } diff --git a/src/PhpWord/TemplateProcessor.php b/src/PhpWord/TemplateProcessor.php index 14c95b18..09f54619 100644 --- a/src/PhpWord/TemplateProcessor.php +++ b/src/PhpWord/TemplateProcessor.php @@ -261,7 +261,7 @@ class TemplateProcessor $subject = utf8_encode($subject); } - return $subject; + return (!is_null($subject)) ? $subject : ''; } /**