From a526ba13c471e60e7a14b5bf11681b09c1d51192 Mon Sep 17 00:00:00 2001 From: Angela Kuznetsova Date: Wed, 4 Feb 2026 16:52:01 +1300 Subject: [PATCH] fix: PHP 8.5 using null as an array offset is deprecated in URISchemeRegistry.php --- library/HTMLPurifier/URISchemeRegistry.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/HTMLPurifier/URISchemeRegistry.php b/library/HTMLPurifier/URISchemeRegistry.php index 4ac8a0b76..f64853479 100644 --- a/library/HTMLPurifier/URISchemeRegistry.php +++ b/library/HTMLPurifier/URISchemeRegistry.php @@ -44,6 +44,11 @@ public function getScheme($scheme, $config, $context) $config = HTMLPurifier_Config::createDefault(); } + // Scheme cannot be null + if ($scheme === null) { + return; + } + // important, otherwise attacker could include arbitrary file $allowed_schemes = $config->get('URI.AllowedSchemes'); if (!$config->get('URI.OverrideAllowedSchemes') &&