File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
library/HTMLPurifier/Injector Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,8 @@ public function handleElement(&$token)
7474
7575 if ($ current instanceof HTMLPurifier_Token_End && $ current ->name === 'span ' ) {
7676 // Mark closing span tag for deletion
77- $ this ->markForDeletion ->attach ($ current );
77+ // PHP 8.5 compatiblity: replaced attach() with offsetSet()
78+ $ this ->markForDeletion ->offsetSet ($ current );
7879 // Delete open span tag
7980 $ token = false ;
8081 }
@@ -85,8 +86,11 @@ public function handleElement(&$token)
8586 */
8687 public function handleEnd (&$ token )
8788 {
88- if ($ this ->markForDeletion ->contains ($ token )) {
89- $ this ->markForDeletion ->detach ($ token );
89+ // PHP 8.5 compatiblity:
90+ // replaced contains() with offsetExists()
91+ // replaced detach() with offsetUnset()
92+ if ($ this ->markForDeletion ->offsetExists ($ token )) {
93+ $ this ->markForDeletion ->offsetUnset ($ token );
9094 $ token = false ;
9195 }
9296 }
You can’t perform that action at this time.
0 commit comments