From 1ef8d7fa56186929627e5b751789c2af7f07dba6 Mon Sep 17 00:00:00 2001 From: Alan Hardman Date: Wed, 19 Feb 2025 11:00:32 -0700 Subject: [PATCH] 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). --- app/helper/view.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/helper/view.php b/app/helper/view.php index f678fcb7..b8db3b22 100644 --- a/app/helper/view.php +++ b/app/helper/view.php @@ -77,8 +77,15 @@ public function parseText($str, $options = [], $ttl = null) } // Simplistic XSS protection + // TODO: remove error_reporting hack after voku/portable-utf8 is updated + if (PHP_VERSION_ID >= 80400) { + error_reporting(E_ALL & ~(E_NOTICE | E_USER_NOTICE | E_DEPRECATED)); + } $antiXss = new \voku\helper\AntiXSS(); $str = $antiXss->xss_clean($str); + if (PHP_VERSION_ID >= 80400) { + error_reporting(E_ALL & ~(E_NOTICE | E_USER_NOTICE)); + } // Pass to any plugin hooks $str = \Helper\Plugin::instance()->callHook("text.parse.after", $str);