Skip to content

Commit 1ef8d7f

Browse files
committed
Hack for PHP 8.4 compat
This should be reverted/changed after voku/portable-utf8 is updated to support PHP 8.4 properly (and the anti-xss dependency is updated).
1 parent 6942432 commit 1ef8d7f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/helper/view.php

+7
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,15 @@ public function parseText($str, $options = [], $ttl = null)
7777
}
7878

7979
// Simplistic XSS protection
80+
// TODO: remove error_reporting hack after voku/portable-utf8 is updated
81+
if (PHP_VERSION_ID >= 80400) {
82+
error_reporting(E_ALL & ~(E_NOTICE | E_USER_NOTICE | E_DEPRECATED));
83+
}
8084
$antiXss = new \voku\helper\AntiXSS();
8185
$str = $antiXss->xss_clean($str);
86+
if (PHP_VERSION_ID >= 80400) {
87+
error_reporting(E_ALL & ~(E_NOTICE | E_USER_NOTICE));
88+
}
8289

8390
// Pass to any plugin hooks
8491
$str = \Helper\Plugin::instance()->callHook("text.parse.after", $str);

0 commit comments

Comments
 (0)