[5.2] PHP Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated#44876
[5.2] PHP Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated#44876pe7er merged 5 commits intojoomla:5.2-devfrom
Conversation
|
I have tested this item ✅ successfully on 0059c80 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44876. |
|
Hmm, I'm not sure if this PR is right. Currently without the PR, the trim is applied on the alias before the check if it is empty: So if someone enters spaces as alias in the form, that will not be used, and the title will be used. Now with the PR you move trim to after the check, so if someone enters spaces as alias in the form, it will be used and not the title because the empty check for a string with spaces will return false: Maybe the following code would be better? I.e. leave order of processing like it is without this PR and use the null coalescing operator inside the trim call to not let it operate on a null value. |
|
Agree with Richard. @alikon Could you please implement the change suggested by Richard? |
|
done |
|
I have tested this item ✅ successfully on 3ac3c7c This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44876. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44876. |
|
Thanks @alikon ! |
Pull Request for Issue ##44872 .
Summary of Changes
fix PHP Deprecated: trim(): Passing null to parameter
Testing Instructions
Set Error Reporting to Maximum.
Edit a banner.
Type in a new category.
Select Save & Close button.
See PHP error log:
Actual result BEFORE applying this Pull Request
Deprecated
Expected result AFTER applying this Pull Request
no more Deprecated
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