? ? PHP 8.x Pending

User tests: Successful: Unsuccessful:

avatar beat
beat
25 Jan 2022

Pull Request for Issue # none

Summary of Changes

This is the Joomla 4.1 identical correspondent pendent of the Joomla 3.10 PR #36804 that got merged, and replaces previous Joomla 4.0 PR #36761 that got outdated due to the cool refactoring of editors into Traits.

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 on any tinymce window should show it too.

Actual result BEFORE applying this Pull Request

This is the result on 4.0 (in 4.1-dev, it's erroring on line 380 of DisplayTrait.php instead of line 538 of tinymce.php):

  • Deprecated: htmlentities(): Passing null to parameter # 2 ($flags) of type int is deprecated in /home/beat/www/4.0/plugins/editors/tinymce/tinymce.php on line 538
  • Deprecated: htmlentities(): Passing null to parameter # 4 ($double_encode) of type bool is deprecated in /home/beat/www/4.0/plugins/editors/tinymce/tinymce.php on line 538

Expected result AFTER applying this Pull Request

No errors.

Documentation Changes Required

None.

avatar beat beat - open - 25 Jan 2022
avatar beat beat - change - 25 Jan 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jan 2022
Category Front End Plugins
avatar beat beat - change - 25 Jan 2022
Labels Added: ?
avatar Quy
Quy - comment - 5 Feb 2022

Please fix conflicts.

avatar Quy Quy - test_item - 12 Feb 2022 - Tested successfully
avatar Quy
Quy - comment - 12 Feb 2022

I have tested this item successfully on 5356a79


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36846.

avatar laoneo
laoneo - comment - 21 Mar 2022

I have tested this item successfully on 5356a79


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36846.

avatar laoneo laoneo - test_item - 21 Mar 2022 - Tested successfully
avatar laoneo laoneo - change - 21 Mar 2022
Status Pending Ready to Commit
avatar laoneo
laoneo - comment - 21 Mar 2022

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36846.

avatar bembelimen bembelimen - change - 21 Mar 2022
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2022-03-24 20:10:31
Closed_By bembelimen
Labels Added: ? PHP 8.x
avatar bembelimen
bembelimen - comment - 24 Mar 2022

Thx

Add a Comment

Login with GitHub to post a comment