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

Regression: Fix undefined offset: 1 #17139

Merged
merged 4 commits into from Aug 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions libraries/src/Environment/Browser.php
Expand Up @@ -279,7 +279,9 @@ public function match($userAgent = null, $accept = null)

list ($this->majorVersion, $this->minorVersion) = explode('.', $version[1]);
}
elseif (preg_match('/Chrome[\/ ]([0-9.]+)|CrMo[\/ ]([0-9.]+)|CriOS[\/ ]([0-9.]+)/i', $this->agent, $version))
elseif (preg_match('/Chrome[\/ ]([0-9.]+)/i', $this->agent, $version)
|| preg_match('/CrMo[\/ ]([0-9.]+)/i', $this->agent, $version)
|| preg_match('/CriOS[\/ ]([0-9.]+)/i', $this->agent, $version))
{
$this->setBrowser('chrome');

Expand All @@ -291,7 +293,10 @@ public function match($userAgent = null, $accept = null)
{
$this->setBrowser('palm');
}
elseif ((preg_match('/MSIE ([0-9.]+)|Internet Explorer\/([0-9.]+)|Trident\/([0-9.]+)/i', $this->agent, $version)))
elseif (preg_match('/MSIE ([0-9.]+)/i', $this->agent, $version)
|| preg_match('/IE ([0-9.]+)/i', $this->agent, $version)
|| preg_match('/Internet Explorer[\/ ]([0-9.]+)/i', $this->agent, $version)
|| preg_match('/Trident\/.*rv:([0-9.]+)/i', $this->agent, $version))
{
$this->setBrowser('msie');

Expand Down