No Code Attached Yet bug
avatar ssabatini
ssabatini
23 Apr 2024

Steps to reproduce the issue

View PHP Error log for Joomla site with PHP 8.2.X.
Look for warnings "stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated ..."

Expected result

No warnings regarding "stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated ..." anymore.

Actual result

#42830 has fixed this warning only in the function detectBrowser(), but the same warning (with the same reason) is produced by the functions detectEngine() and detectPlatform().

Additionally, the function detectRobot() does as well not test if the user agent is null.

avatar ssabatini ssabatini - open - 23 Apr 2024
avatar joomla-cms-bot joomla-cms-bot - change - 23 Apr 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 Apr 2024
avatar Quy Quy - change - 24 Apr 2024
Labels Added: bug
avatar Quy Quy - labeled - 24 Apr 2024
avatar alikon
alikon - comment - 25 Apr 2024
avatar ssabatini
ssabatini - comment - 26 Apr 2024

@alikon The fix looks good. The first fix with issue #42830 should be unnecessary now; the if ($userAgent !== null) in the method detectBrowser can be removed.

avatar Quy
Quy - comment - 2 Oct 2024
avatar ssabatini
ssabatini - comment - 10 Nov 2024

The fix 131 does not solve null $userAgent in detectEngine($userAgent) and detectPlatform($userAgent). I would propose to use the solution provided in 124.

Add a Comment

Login with GitHub to post a comment