[4.2] webclient user agents
david19161 opened this issue · comments
Steps to reproduce the issue
Somehow! set your user agent to "Chrome Privacy Preserving Prefetch Proxy"
Expected result
no warnings
Actual result
Undefined array key 1 in libraries/vendor/joomla/application/src/Web/WebClient.php on line 439
System information (as much as possible)
joomla 4.2.6
php 8.0.23
Additional comments
seeing a lot of these in the php error log.
its obvious why, there is no "/" in the user agent string
Something seems to be wrong with your testing instructions. Line 439 is surrounded by
elseif (stripos($userAgent, 'Chrome') !== false)
{
}
but there is no Chrome
in your UserAgent string.
For reference: https://developers.google.com/search/docs/crawling-indexing/overview-google-crawlers
As far as I see Google never adds the string Chrome/W.X.Y.Z
to Feedfetcher user agents or just Chrome
.
It looks like somebody is visiting your site with a badly faked user agent. Block them!
Or do I miss something?
corrected instructions
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39637.
user agent is "Chrome Privacy Preserving Prefetch Proxy"
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39637.
Maybe a solution could be:
elseif (stripos($userAgent, 'Chrome/') !== false)
The correct repository for this issue is https://github.com/joomla-framework/application
I'm out.
can I work on this issue?
there is no need to ask, please submit your pull request
Like said in #39637 (comment) it's not the joomla-cms repository here but joomla-framework. See joomla-framework/application#112 there.
Add a "/" to the end of the user agent string.
Update the version of Joomla or PHP to ensure compatibility with the user agent string.
Closing this here as a relevant issue has been created in the upstream library