joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.69k stars 3.63k forks source link

PHP 8.2 Legacy Error in WebClient.php not solved by #42830 #43334

Open ssabatini opened 2 months ago

ssabatini commented 2 months ago

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 https://github.com/joomla/joomla-cms/pull/1 ($haystack) of type string is deprecated ..."

Expected result

No warnings regarding "stripos(): Passing null to parameter https://github.com/joomla/joomla-cms/pull/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.

alikon commented 2 months ago

please check https://github.com/joomla-framework/application/pull/124

ssabatini commented 2 months ago

@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.