? bug Maintainers Checked PR-5.0-dev Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
8 Sep 2023

Summary of Changes

When registering a user, we export the whole data set of the user object to be used in the mail templates. Some of those values are actually NULL, for example isRoot or lastResetTime, etc. In line 350, we are doing a str_replace() on the tag with the value, in this case NULL. In PHP 8.1 (maybe even 8.0, didn't test.) this throws a notice, since str_replace() shouldn't be called with a NULL value.

I thought about how to solve the problem. The first idea was to just hopp over such an empty value, but that would leave a potential template tag in the mail. So I opted for replacing the value from NULL to an empty string.

Testing Instructions

Can we do this with a code review? It is difficult to provide testing instructions without fabricating a component to display the issue and not have it hidden in a redirect...

Actual result BEFORE applying this Pull Request

Expected result AFTER applying this Pull Request

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar joomla-cms-bot joomla-cms-bot - change - 8 Sep 2023
Category Libraries
avatar Hackwar Hackwar - open - 8 Sep 2023
avatar Hackwar Hackwar - change - 8 Sep 2023
Status New Pending
avatar Hackwar Hackwar - change - 14 Sep 2023
Labels Added: PR-5.0-dev
avatar HLeithner
HLeithner - comment - 24 Sep 2023

why is this a draft?

avatar Hackwar
Hackwar - comment - 24 Sep 2023

Because I didn't get around to write the test instructions yet.

avatar Hackwar Hackwar - change - 10 Oct 2023
Labels Added: bug Maintainers Checked
avatar Hackwar Hackwar - change - 10 Oct 2023
The description was changed
avatar Hackwar Hackwar - edited - 10 Oct 2023
avatar Quy Quy - test_item - 10 Oct 2023 - Tested successfully
avatar Quy
Quy - comment - 10 Oct 2023

I have tested this item ✅ successfully on 3141e13

Before PR:
PHP Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in \libraries\src\Mail\MailTemplate.php on line 350


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

avatar alikon alikon - test_item - 10 Oct 2023 - Tested successfully
avatar alikon
alikon - comment - 10 Oct 2023

I have tested this item ✅ successfully on 3141e13


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

avatar alikon alikon - change - 10 Oct 2023
Status Pending Ready to Commit
avatar alikon
alikon - comment - 10 Oct 2023

RTC


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

avatar Quy Quy - change - 10 Oct 2023
Labels Added: ?
avatar HLeithner HLeithner - change - 17 Oct 2023
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-10-17 20:15:07
Closed_By HLeithner
avatar HLeithner HLeithner - close - 17 Oct 2023
avatar HLeithner HLeithner - merge - 17 Oct 2023
avatar HLeithner
HLeithner - comment - 17 Oct 2023

thanks

Add a Comment

Login with GitHub to post a comment