User tests: Successful: Unsuccessful:
Fixes Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in libraries/src/Mail/MailTemplate.php on line 297
Pull Request for Issue # none.
Obvious fix to avoid a default null (instead of empty string) passed to trim() which generates a deprecated warning in PHP 8.1.
Code review is enough imho.
To reproduce:
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/beat/www/4.1/libraries/src/Mail/MailTemplate.php on line 297
# | Time | Memory | Function | Location
-- | -- | -- | -- | --
1 | 0.0058 | 364520 | {main}( ) | .../index.php:0
2 | 0.0223 | 365880 | require_once( '/home/beat/www/4.1/administrator/includes/app.php ) | .../index.php:32
3 | 0.2463 | 1853712 | Joomla\CMS\Application\CMSApplication->execute( ) | .../app.php:63
4 | 2.2751 | 6298176 | Joomla\CMS\Application\AdministratorApplication->render( ) | .../CMSApplication.php:284
5 | 2.2752 | 6298216 | Joomla\CMS\Application\CMSApplication->render( ) | .../AdministratorApplication.php:514
6 | 2.5000 | 8513024 | Joomla\CMS\Application\WebApplication->triggerEvent( $eventName = 'onAfterRender', $args = ??? ) | .../CMSApplication.php:1045
7 | 2.5000 | 8513120 | Joomla\Event\Dispatcher->dispatch( $name = 'onAfterRender', $event = class Joomla\Event\Event { protected $name = 'onAfterRender'; protected $arguments = []; protected $stopped = FALSE } ) | .../EventAware.php:111
8 | 2.5002 | 8513768 | Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure:/home/beat/www/4.1/libraries/src/Plugin/CMSPlugin.php:267-296}( $event = class Joomla\Event\Event { protected $name = 'onAfterRender'; protected $arguments = []; protected $stopped = FALSE } ) | .../Dispatcher.php:486
9 | 2.5002 | 8513768 | PlgSystemUpdatenotification->onAfterRender( ) | .../CMSPlugin.php:285
10 | 3.0070 | 8978392 | Joomla\CMS\Mail\MailTemplate->send( ) | .../updatenotification.php:271
11 | 3.0117 | 8993992 | trim( $string = NULL ) | .../MailTemplate.php:297
No error.
None.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
|
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-03-30 20:23:10 |
Closed_By | ⇒ | bembelimen | |
Labels |
Added:
?
PHP 8.x
|
Thx
I have tested this item✅ successfully on 5ffd955
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37384.