-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[5.2] deprecated warning in error_log caused by detectEngine() if $userAgent contains "Chrome" but no version after a space character #44469
Comments
This issue has to be fixed in the application framework https://github.com/joomla-framework/application . Unfortunately I think it will not be fixed by the already merged PR joomla-framework/application#131 . See also this issue there which seems to have the same root cause: joomla-framework/application#112 . I have added a comment to that issue with reference to this issue here. |
Please test joomla-framework/application#132 and report back the result in a comment there. Thanks in advance. |
@ssabatini Could you post the exact user agent string here so I can use that for a unit test in my PR mentioned in my previous comment? Thanks in advance. |
On Tue Nov 12 23:04:25, I find this 2 entries in the Apache access log:
Probably, it was the first one, as this user string does not contain a slash ('/') character. } elseif (\stripos($userAgent, 'Chrome') !== false) {
$result = \explode('/', \stristr($userAgent, 'Chrome'));
$version = \explode(' ', $result[1]);
if ($version[0] >= 28) {
$this->engine = self::BLINK;
} else {
$this->engine = self::WEBKIT;
} I see another problem here (and in other places): The code assumes that the value after the slash is a number. This will fail as well if the user agent is something like |
@ssabatini Yes, problem is the first one. The user agent "Chrome Privacy Preserving Prefetch Proxy" is used by the https://developer.chrome.com/blog/private-prefetch-proxy and does not provide a version by purpose. If you check the changes made by my pull request, which is currently ongoing work, you will see that the issue is handled with my PR: https://github.com/joomla-framework/application/pull/132/files Because there is no version appended with a slash, the The reason why my PR is work in progress is because I am not sure yet if I shall handle any theoretical case of user agents without a version or only this well know one mentioned above. Anyway: Instead of having a theoretical discussion here, please test if the changes from my PR solve your issue and report back the result in a comment there. Thanks in advance. |
Steps to reproduce the issue
Access WebClient with a user agent containing "Chrome" but no version after a space character.
Expected result
No warning in error log
Actual result
2 warnings in error log:
The text was updated successfully, but these errors were encountered: