Skip to content

fix: PHP 8.5 compatibility in RemoveSpansWithoutAttributes.php#463

Closed
odysseuscm wants to merge 1 commit intoezyang:masterfrom
odysseuscm:patch-1
Closed

fix: PHP 8.5 compatibility in RemoveSpansWithoutAttributes.php#463
odysseuscm wants to merge 1 commit intoezyang:masterfrom
odysseuscm:patch-1

Conversation

@odysseuscm
Copy link

PHP 8.5 compatibility
contains() is deprecated in PHP 8.5; use offsetExists() instead

PHP 8.5 compatibility
contains() is deprecated in PHP 8.5; use offsetExists() instead
@bytestream
Copy link
Contributor

You may as well go the full hog and update the other deprecation notices shown in the ci log as well 🫠

@odysseuscm odysseuscm changed the title Update RemoveSpansWithoutAttributes.php fix: Update RemoveSpansWithoutAttributes.php Nov 26, 2025
@odysseuscm odysseuscm changed the title fix: Update RemoveSpansWithoutAttributes.php fix: PHP 8.5 compatibility in RemoveSpansWithoutAttributes.php Nov 26, 2025
@odysseuscm
Copy link
Author

You may as well go the full hog and update the other deprecation notices shown in the ci log as well 🫠

The problem is, that those fails are due to simpletest which is outdated and as far as I know no longer maintained. The incompatible code is in simpletest, not in htmlpurifier.
htmlpurifier should probably move to PHPUnit, but I guess that should be done by ezyang.

@bytestream
Copy link
Contributor

The tests are failing because of deprecation notices in HTMLPurifier not because of issues in simpletest.

For your convenience:

Exception 1!
Unexpected PHP Error [Using null as an array offset is deprecated, use an empty string instead] severity [8192] in [/home/runner/work/htmlpurifier/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php line 55]
	in testDefaultSchemeNull
	in HTMLPurifier_AttrDef_URITest

Exception 2!
Unexpected PHP Error [Using null as an array offset is deprecated, use an empty string instead] severity [8192] in [/home/runner/work/htmlpurifier/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php line 58]
	in testDefaultSchemeNull
	in HTMLPurifier_AttrDef_URITest

Exception 3!
Unexpected PHP Error [Method SplObjectStorage::attach() is deprecated since 8.5, use method SplObjectStorage::offsetSet() instead] severity [8192] in [/home/runner/work/htmlpurifier/htmlpurifier/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php line 77]
	in testSingleSpan
	in HTMLPurifier_Injector_RemoveSpansWithoutAttributesTest

Exception 12!
Unexpected PHP Error [Method SplObjectStorage::detach() is deprecated since 8.5, use method SplObjectStorage::offsetUnset() instead] severity [8192] in [/home/runner/work/htmlpurifier/htmlpurifier/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php line 90]
	in testDeeplyNestedSpan
	in HTMLPurifier_Injector_RemoveSpansWithoutAttributesTest

@odysseuscm
Copy link
Author

hey, thanks. I'm not very proficient in github. I only saw the large number of simpletest errors, not the ones you listed.

@odysseuscm odysseuscm closed this by deleting the head repository Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants