Avoid a deprecated error from PHP8.1 (#573)

Co-authored-by: Nicola Asuni <nicolaasuni@users.noreply.github.com>
Co-authored-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
Bart Driessen 2022-12-17 16:59:09 +07:00 committed by GitHub
parent a336b531f6
commit ef356f0bc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -286,7 +286,7 @@ class TCPDF_STATIC {
*/
public static function _escapeXML($str) {
$replaceTable = array("\0" => '', '&' => '&amp;', '<' => '&lt;', '>' => '&gt;');
$str = strtr($str, $replaceTable);
$str = strtr($str === null ? '' : $str, $replaceTable);
return $str;
}