Problems with null parameters in PHP8.3 and Joomla5

For Joomla! 5.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
ilkerf
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Feb 27, 2024 10:38 am

Problems with null parameters in PHP8.3 and Joomla5

Post by ilkerf » Tue Feb 27, 2024 10:58 am

Hi,

I get these errors when viewing categories using Joomla5.0.3 with PHP8.3:

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /.../plugins/system/t4/src/t4/T4.php on line 188

Deprecated: mb_strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /.../libraries/vendor/joomla/string/src/phputf8/mbstring/core.php on line 44

Deprecated: mb_strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /.../libraries/vendor/joomla/string/src/phputf8/mbstring/core.php on line 44


I corrected them by:

in core.php:

by changing the line 44:

return mb_strpos($str, $search);

with:

if ( $str == null ) return false;
return mb_strpos($str, $search);


and, in T4.php:

by adding:

if ( $buffer != null )

in front of the following lines starting from 188th row in T4.php

$buffer = str_replace(array(...

and subsequent lines starting with if (preg_match...

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9711
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Problems with null parameters in PHP8.3 and Joomla5

Post by AMurray » Tue Feb 27, 2024 9:55 pm

PHP 8.3 was released a week ago. No surprise it may have 'bugs'. Recommended PHP for J5 is PHP 8.2 so I would stick with that.
Regards - A Murray
General Support Moderator

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30888
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Problems with null parameters in PHP8.3 and Joomla5

Post by Per Yngve Berg » Tue Feb 27, 2024 10:46 pm

Turn off Error Reporting and report the bugs to the developer of the T4 Framework.


Post Reply

Return to “Joomla! 5.x Coding”