summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/config/user_agents.php2
-rw-r--r--system/libraries/User_agent.php2
-rw-r--r--user_guide_src/source/changelog.rst1
3 files changed, 4 insertions, 1 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',
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];
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 5b0187350..67a2685da 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -651,6 +651,7 @@ Bug fixes for 3.0
- Fixed a bug (#2762) - :doc:`Hooks Class <general/hooks>` didn't properly check if the called class/function exists.
- Fixed a bug (#148) - while sanitizing input data, ``CI_Input::_clean_input_data()`` assumed that it is URL-encoded, stripping certain character sequences from it.
- Fixed a bug (#346) - with ``$config['global_xss_filtering']`` turned on, the ``$_GET``, ``$_POST``, ``$_COOKIE`` and ``$_SERVER`` superglobals were overwritten during initialization time, resulting in XSS filtering being either performed twice or there was no possible way to get the original data, even though options for this do exist.
+- Fixed an edge case (#555) - incorrect browser version was reported for Opera 10+ due to a non-standard user-agent string.
Version 2.1.4
=============