From 10925d27adac84634cc527d7298b1add0d54ba7c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 9 Jan 2014 00:16:46 +0200 Subject: 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/' to the end of the user agent string. Fixes issue #555 (incorrect browser detection for Opera) --- system/libraries/User_agent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system') diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index 50ac9be98..e13bf8513 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -282,7 +282,7 @@ class CI_User_agent { { foreach ($this->browsers as $key => $val) { - if (preg_match('|'.preg_quote($key).'.*?([0-9\.]+)|i', $this->agent, $match)) + if (preg_match('|'.$key.'.*?([0-9\.]+)|i', $this->agent, $match)) { $this->is_browser = TRUE; $this->version = $match[1]; -- cgit v1.2.3-24-g4f1b