Skip to content

Commit 9436cb6

Browse files
committed
[FIX] Deprecated htmlspecialchars().
1 parent 6acc02b commit 9436cb6

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

core/src/Legacy/PhpCompat.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class PhpCompat implements PhpCompatInterface
1717
public function htmlspecialchars($str = '', $flags = ENT_COMPAT, $encode = '', $safecount = 0)
1818
{
1919
$safecount++;
20-
$modx = evolutionCMS();
2120

2221
if (1000 < $safecount) {
2322
exit("error too many loops '{$safecount}'");
@@ -29,9 +28,9 @@ public function htmlspecialchars($str = '', $flags = ENT_COMPAT, $encode = '', $
2928
}
3029
} elseif ($str !== '') {
3130
if ($encode !== '') {
32-
$encode = $modx->getConfig('modx_charset');
31+
$encode = evo()->getConfig('modx_charset');
3332
}
34-
$ent_str = htmlspecialchars($str, $flags, $encode);
33+
$ent_str = htmlspecialchars(($str ?? ''), $flags, $encode);
3534

3635
if (!empty($str) && empty($ent_str)) {
3736
$detect_order = implode(',', mb_detect_order());

0 commit comments

Comments
 (0)