diff options
author | Andrey Andreev <narf@devilix.net> | 2014-01-08 23:16:46 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-01-08 23:16:46 +0100 |
commit | 10925d27adac84634cc527d7298b1add0d54ba7c (patch) | |
tree | c81e28d781f4a2668d44ed2c6461f2d9b0e4c55f /application/config/user_agents.php | |
parent | 4ea76cc2216b19bfae38dbbfe7104c21ee278d81 (diff) |
Remove preg_quote() call from CI_User_agent::_set_browser() and add another pattern for Opera
Input comes from a configuration file that is barely touched by anyone
and the default values only contain letters, so it is safe to not
quote them.
This enables us to add a more advanced pattern in config/user_agents.php
for Opera 10+, which ... quote:
Opera/9.80 is hard coded at the beginning of the user agent string because of broken browser sniffing scripts which detect 'Opera/10' and above as Opera 1.
(reference: http://my.opera.com/community/openweb/idopera/)
Instead, latests versions of Opera append ' Version/<version number>'
to the end of the user agent string.
Fixes issue #555 (incorrect browser detection for Opera)
Diffstat (limited to 'application/config/user_agents.php')
-rw-r--r-- | application/config/user_agents.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/application/config/user_agents.php b/application/config/user_agents.php index e555d77c6..2af70bf9c 100644 --- a/application/config/user_agents.php +++ b/application/config/user_agents.php @@ -85,6 +85,8 @@ $browsers = array( 'OPR' => 'Opera', 'Flock' => 'Flock', 'Chrome' => 'Chrome', + // Opera 10+ always reports Opera/9.80 and appends Version/<real version> to the user agent string + 'Opera.*?Version' => 'Opera', 'Opera' => 'Opera', 'MSIE' => 'Internet Explorer', 'Internet Explorer' => 'Internet Explorer', |