diff --git a/NEWS b/NEWS index d69ca2ac3..f1e7caaf7 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,12 @@ +# [4.19.1](https://github.com/ezyang/htmlpurifier/compare/v4.19.0...v4.19.1) (2026-07-06) + + +### Bug Fixes + +* fix SplObjectStorage deprecated methods for PHP 8.5: attach()→offsetSet(), detach()→offsetUnset(), contains()→offsetExists() +* fix null array offset deprecation in URISchemeRegistry for PHP 8.5 + + # [4.19.0](https://github.com/ezyang/htmlpurifier/compare/v4.18.0...v4.19.0) (2025-10-17) diff --git a/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php b/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php index 42d514447..425b28016 100644 --- a/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php +++ b/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php @@ -74,7 +74,7 @@ public function handleElement(&$token) if ($current instanceof HTMLPurifier_Token_End && $current->name === 'span') { // Mark closing span tag for deletion - $this->markForDeletion->attach($current); + $this->markForDeletion->offsetSet($current, null); // Delete open span tag $token = false; } @@ -85,8 +85,8 @@ public function handleElement(&$token) */ public function handleEnd(&$token) { - if ($this->markForDeletion->contains($token)) { - $this->markForDeletion->detach($token); + if ($this->markForDeletion->offsetExists($token)) { + $this->markForDeletion->offsetUnset($token); $token = false; } } diff --git a/library/HTMLPurifier/URISchemeRegistry.php b/library/HTMLPurifier/URISchemeRegistry.php index 4ac8a0b76..e0766ebe5 100644 --- a/library/HTMLPurifier/URISchemeRegistry.php +++ b/library/HTMLPurifier/URISchemeRegistry.php @@ -40,6 +40,7 @@ public static function instance($prototype = null) */ public function getScheme($scheme, $config, $context) { + $scheme = (string) $scheme; if (!$config) { $config = HTMLPurifier_Config::createDefault(); }