Skip to content

Commit 077175e

Browse files
committed
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
1 parent 83b0bef commit 077175e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PhpWord/Escaper/Xml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ class Xml extends AbstractEscaper
2727
protected function escapeSingleValue($input)
2828
{
2929
// todo: omit encoding parameter after migration onto PHP 5.4
30-
return htmlspecialchars($input, ENT_QUOTES, 'UTF-8');
30+
return (!is_null($input)) ? htmlspecialchars($input, ENT_QUOTES, 'UTF-8') : null;
3131
}
3232
}

0 commit comments

Comments
 (0)