summaryrefslogtreecommitdiffstats
path: root/system/libraries
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 /system/libraries
parent9d0ab04e1e39bc93c59f60844dd2cf9176443028 (diff)
Fix #1255
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/User_agent.php8
1 files changed, 7 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);
}
// --------------------------------------------------------------------