From 077175efbef67fbaef1e3145b7d544e1b2c17893 Mon Sep 17 00:00:00 2001 From: neopheus Date: Mon, 12 Sep 2022 13:48:13 +0200 Subject: [PATCH] Fix : htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated --- src/PhpWord/Escaper/Xml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/Escaper/Xml.php b/src/PhpWord/Escaper/Xml.php index a769c5e1..073e297d 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 htmlspecialchars($input, ENT_QUOTES, 'UTF-8'); + return (!is_null($input)) ? htmlspecialchars($input, ENT_QUOTES, 'UTF-8') : null; } }