Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ssabatini opened this issue Apr 23, 2024 · 5 comments
Closed

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

ssabatini opened this issue Apr 23, 2024 · 5 comments

Comments

@ssabatini
Copy link

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.

@alikon
Copy link
Contributor

alikon commented Apr 25, 2024

please check joomla-framework/application#124

@ssabatini
Copy link
Author

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

@Quy
Copy link
Contributor

Quy commented Oct 2, 2024

Please test joomla-framework/application#131

@ssabatini
Copy link
Author

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

@richard67
Copy link
Member

Closing as having a pull request. Please test #44585 . Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants