Merge pull request #2292 from neopheus/php8.1-fix-2290
Php 8.1 fix #2290
This commit is contained in:
commit
93e16d4001
|
|
@ -27,6 +27,6 @@ class Xml extends AbstractEscaper
|
||||||
protected function escapeSingleValue($input)
|
protected function escapeSingleValue($input)
|
||||||
{
|
{
|
||||||
// todo: omit encoding parameter after migration onto PHP 5.4
|
// 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') : '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -257,11 +257,11 @@ class TemplateProcessor
|
||||||
*/
|
*/
|
||||||
protected static function ensureUtf8Encoded($subject)
|
protected static function ensureUtf8Encoded($subject)
|
||||||
{
|
{
|
||||||
if (!Text::isUTF8($subject)) {
|
if (!Text::isUTF8($subject) && !is_null($subject)) {
|
||||||
$subject = utf8_encode($subject);
|
$subject = utf8_encode($subject);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $subject;
|
return (!is_null($subject)) ? $subject : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue