summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-10-24 21:03:42 +0200
committerAndrey Andreev <narf@bofh.bg>2012-10-24 21:03:42 +0200
commita0836b9293a50905651e1a2ed624f3e331be765f (patch)
treeabe10c37c1f8a079b52e5d22ae6afd2a90e53b13
parent9d0ab04e1e39bc93c59f60844dd2cf9176443028 (diff)
Fix #1255
-rw-r--r--system/libraries/User_agent.php8
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 8 insertions, 1 deletions
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 <libraries/uri>` didn't always trim slashes from the *uri_string* as shown in the documentation.
- Fixed a bug (#134) - :doc:`Database Caching <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 <libraries/loader>` 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 <libraries/user_agent>` method ``is_referral()`` only checked if ``$_SERVER['HTTP_REFERER']`` exists.
Version 2.1.3
=============