User tests: Successful: Unsuccessful:
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.
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...
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
Category | ⇒ | Libraries |
Status | New | ⇒ | Pending |
Labels |
Added:
PR-5.0-dev
|
Because I didn't get around to write the test instructions yet.
Labels |
Added:
bug
Maintainers Checked
|
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
I have tested this item ✅ successfully on 3141e13
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
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 |
thanks
why is this a draft?