Skip to content

Commit

Permalink
Make referer() behave as expected.
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed Apr 28, 2014
1 parent a28158d commit 43d359b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Controller.php
Expand Up @@ -970,7 +970,7 @@ public function referer($default = null, $local = false) {

$referer = $this->request->referer($local);
if ($referer === '/' && $default) {
return Router::url($default, true);
return Router::url($default, !$local);
}
return $referer;
}
Expand Down

2 comments on commit 43d359b

@jvalecillos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change causes a bug for redirection showed when using AuthComponent. The error consists on duplication of base folder (project folder) in the url. E.g. http://localhost/cakephp/test will be redirected to http://localhost/cakephp/cakephp.

@dereuromark
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverting this wouldn't solve the source of the issue, though.
We need to find the actual problem underneath instead of fixing the symptoms :)

Please sign in to comment.