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

[4.2] webclient user agents #39637

Closed
david19161 opened this issue Jan 15, 2023 · 10 comments
Closed

[4.2] webclient user agents #39637

david19161 opened this issue Jan 15, 2023 · 10 comments

Comments

@david19161
Copy link
Contributor

david19161 commented Jan 15, 2023

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

@ReLater
Copy link
Contributor

ReLater commented Jan 15, 2023

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.

@ReLater
Copy link
Contributor

ReLater commented Jan 15, 2023

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?

@david19161
Copy link
Contributor Author

corrected instructions


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39637.

@david19161
Copy link
Contributor Author

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.

@ReLater
Copy link
Contributor

ReLater commented Jan 15, 2023

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.

@Simran180
Copy link

can I work on this issue?

@alikon
Copy link
Contributor

alikon commented Feb 16, 2023

there is no need to ask, please submit your pull request

@ReLater
Copy link
Contributor

ReLater commented Feb 16, 2023

@Simran180

Like said in #39637 (comment) it's not the joomla-cms repository here but joomla-framework. See joomla-framework/application#112 there.

@Hackwar Hackwar added the bug label Feb 23, 2023
@Rartg
Copy link

Rartg commented Mar 14, 2023

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.

@brianteeman
Copy link
Contributor

Closing this here as a relevant issue has been created in the upstream library

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

8 participants