[3.10] [PHP 8.1] compatibility of htmlentities types in tinymce.php (fixes Deprecated tinymce.php on line 603) #36804
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request for Issue # none.
Summary of Changes
Fixes
Deprecated: htmlentities(): Passing null to parameter #2 ($flags) of type int is deprecated in plugins/editors/tinymce/tinymce.php on line 603
Joomla 3.10 version of Joomla 4.0 #36761
In PHP,
htmlentities()
has following parameters types: 2nd is a non-null int, 4th is à non-null bool.ref.: https://www.php.net/manual/en/function.htmlentities.php
This PR does replace null by their type-conversions: (int) null -> 0, and (bool) null -> false.
Disclaimer: I'm only fixing PHP 8.1 compatibility here.
Testing Instructions
A code-review should be enough here.
I found it with CB internal PMS / New Message, but I guess PHP 8.1 with all errors on and joomla debug on on any tinymce window should show it too.
Actual result BEFORE applying this Pull Request
Deprecated: htmlentities(): Passing null to parameter #2 ($flags) of type int is deprecated in plugins/editors/tinymce/tinymce.php on line 603
Expected result AFTER applying this Pull Request
No errors.
Documentation Changes Required
None.