Skip to content

Commit

Permalink
Trident detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
Varga Zsolt committed Nov 13, 2015
1 parent 3545059 commit a4d4502
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,12 @@ public function osVersion()
/**
* Is this browser an Internet Explorer?
*
* @param boolean $trident Set to true to detect the Trident (IE 12ish?) as well.
* @return boolean
*/
public function isIE()
public function isIE($trident = false)
{
return preg_match('%(^IE$|internet\s+explorer)%i', $this->attributes['browserFamily']);
return preg_match('%(^IE$|internet\s+explorer|MSIE' . ($trident ? '|Trident':'') . ')%i', $this->attributes['browserFamily']);
}

/**
Expand All @@ -188,4 +189,4 @@ protected function clearSemver($version)
{
return preg_replace('%(^0.0.0$|\.0\.0$|\.0$)%', '', $version);
}
}
}

0 comments on commit a4d4502

Please sign in to comment.