? Pending

User tests: Successful: Unsuccessful:

avatar beat
beat
23 Jan 2022

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.

 htmlentities(
    string $string,
    int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401,
    ?string $encoding = null,
    bool $double_encode = true
): string

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.

avatar beat beat - open - 23 Jan 2022
avatar beat beat - change - 23 Jan 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Jan 2022
Category Front End Plugins
avatar beat beat - change - 23 Jan 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-01-23 11:43:53
Closed_By beat
Labels Added: ?
avatar beat beat - close - 23 Jan 2022

Add a Comment

Login with GitHub to post a comment