Skip to content

Commit fa84160

Browse files
committed
str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated"
1 parent 077175e commit fa84160

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
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 (!is_null($input)) ? htmlspecialchars($input, ENT_QUOTES, 'UTF-8') : null;
30+
return (!is_null($input)) ? htmlspecialchars($input, ENT_QUOTES, 'UTF-8') : '';
3131
}
3232
}

src/PhpWord/TemplateProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ protected static function ensureUtf8Encoded($subject)
261261
$subject = utf8_encode($subject);
262262
}
263263

264-
return $subject;
264+
return (!is_null($subject)) ? $subject : '';
265265
}
266266

267267
/**

0 commit comments

Comments
 (0)