Changeset 2738
- Timestamp:
- 06/02/2008 11:16:30 AM (6 months ago)
- Files:
-
- 1 modified
-
trunk/system/helpers/request.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/helpers/request.php
r2639 r2738 26 26 public static function referrer($default = FALSE) 27 27 { 28 return ( ! empty($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : $default; 28 if ( ! empty($_SERVER['HTTP_REFERER'])) 29 { 30 // Get base url 31 $base = url::base((bool) Config::item('core.index_page')); 32 33 // Set referrer 34 $ref = $_SERVER['HTTP_REFERER']; 35 36 if (strpos($ref, $base) === 0) 37 { 38 // Remove the base URL from the referrer 39 $ref = substr($ref, strlen($base)); 40 } 41 } 42 43 return isset($ref) ? $ref : $default; 29 44 } 30 45
