From a0836b9293a50905651e1a2ed624f3e331be765f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 24 Oct 2012 22:03:42 +0300 Subject: Fix #1255 --- system/libraries/User_agent.php | 8 +++++++- user_guide_src/source/changelog.rst | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index ff596f04b..3387d4aa6 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -466,7 +466,13 @@ class CI_User_agent { */ public function is_referral() { - return ! empty($_SERVER['HTTP_REFERER']); + if (empty($_SERVER['HTTP_REFERER'])) + { + return FALSE; + } + + $referer = parse_url($_SERVER['HTTP_REFERER']); + return ! (empty($referer['host']) && strpos(config_item('base_url'), $referer['host']) !== FALSE); } // -------------------------------------------------------------------- diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index ca46e9db1..afe2a6862 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -378,6 +378,7 @@ Bug fixes for 3.0 - Fixed a bug (#779) - :doc:`URI Class ` didn't always trim slashes from the *uri_string* as shown in the documentation. - Fixed a bug (#134) - :doc:`Database Caching ` method ``delete_cache()`` didn't work in some cases due to *cachedir* not being initialized properly. - Fixed a bug (#191) - :doc:`Loader Library ` ignored attempts for (re)loading databases to ``get_instance()->db`` even when the old database connection is dead. +- Fixed a bug (#1255) - :doc:`User Agent Library ` method ``is_referral()`` only checked if ``$_SERVER['HTTP_REFERER']`` exists. Version 2.1.3 ============= -- cgit v1.2.3-24-g4f1b