Skip to content

Commit

Permalink
Regression: Fix undefined offset: 1 (#17139)
Browse files Browse the repository at this point in the history
* Fix undefined offset: 1

* Fix undefined offset: 1
  • Loading branch information
Quy authored and Michael Babker committed Aug 12, 2017
1 parent c1d93d8 commit 4a5a043
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libraries/src/Environment/Browser.php
Original file line number Diff line number Diff line change
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

0 comments on commit 4a5a043

Please sign in to comment.