diff options
Diffstat (limited to 'system/libraries/User_agent.php')
-rw-r--r-- | system/libraries/User_agent.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index ff596f04b..e920578d9 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -1,4 +1,4 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php /** * CodeIgniter * @@ -24,6 +24,7 @@ * @since Version 1.0 * @filesource */ +defined('BASEPATH') OR exit('No direct script access allowed'); /** * User Agent Class @@ -466,7 +467,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); } // -------------------------------------------------------------------- |