Fix for $request->redirect() bug when Kohana:$index_file is activated #210

Closed
wants to merge 2 commits into
from

2 participants

@buremba

There was a problem in $request->redirect() when Kohana:$index_file is activated. Kohana:$index_file must be a string value or FALSE not TRUE.

@MazeXD MazeXD commented on the diff Jan 28, 2012
classes/kohana/request.php
@@ -936,13 +937,13 @@ public function redirect($url = '', $code = 302)
if (strpos($referrer, '://') === FALSE)
{
- $referrer = URL::site($referrer, TRUE, Kohana::$index_file);
+ $referrer = URL::site($referrer, TRUE, TRUE);
@MazeXD
MazeXD added a line comment Jan 28, 2012

I recommend this snippet cause it's valid for both enabled and disabled index_file.

$referrer = URL::site($referrer, TRUE, !empty(Kohana::$index_file));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@MazeXD MazeXD commented on the diff Jan 28, 2012
classes/kohana/request.php
}
if (strpos($url, '://') === FALSE)
{
// Make the URI into a URL
- $url = URL::site($url, TRUE, Kohana::$index_file);
+ $url = URL::site($url, TRUE, TRUE);
@MazeXD
MazeXD added a line comment Jan 28, 2012

I recommend this snippet cause it's valid for both enabled and disabled index_file.

$url = URL::site($url, TRUE, !empty(Kohana::$index_file));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Kohana-Builds

Pull request is targeted towards an invalid branch (3.2/master). Usually, this means you have targeted the master, rather than develop branch. Please correct this and try again. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment