fix for Controller::referer

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5528 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-08-15 18:05:28 +00:00
parent 5c48a926e7
commit 1e56828522

View file

@ -675,9 +675,8 @@ class Controller extends Object {
*/
function referer($default = null, $local = false) {
$ref = env('HTTP_REFERER');
$base = FULL_BASE_URL . $this->webroot;
if ($ref != null && defined('FULL_BASE_URL')) {
if (!empty($ref) && defined('FULL_BASE_URL')) {
$base = FULL_BASE_URL . $this->webroot;
if (strpos($ref, $base) === 0) {
return substr($ref, strlen($base) - 1);
} elseif (!$local) {