Bug Report #4141

Fix Request::redirect() when using an index_page

Added by Martin Ledgard 10 months ago. Updated 3 months ago.

Status:Needs Test Start date:07/27/2011
Priority:Normal Due date:
Assignee:Sam de Freyssinet % Done:

90%

Category:Core
Target version:v3.2.1
Resolution:fixed Points:1

Description

Commit 035155e broke request redirection when using an index_page a few days ago, since URL::base() expects the $index parameter to be a boolean, not a string.

see https://github.com/kohana/core/pull/148

Associated revisions

Revision b7869b16
Added by Matt Button 10 months ago

Respect index.php settings in redirect, needs test refs #4141

History

Updated by Jeremy Bush 10 months ago

  • Target version set to v3.2.1

Updated by Matt Button 10 months ago

  • Category set to Core
  • Status changed from New to Needs Test
  • Assignee set to Sam de Freyssinet
  • % Done changed from 0 to 90
  • Resolution set to fixed

Not sure if/how Sam wants to handle this as the redirect method is currently untestable

Updated by Максим Нагайченко 8 months ago

Don't work see line 939 and 945 in file classes/kohana/request.php (https://github.com/kohana/core/blob/44fcb1b68a760f4d9ab46607776671b2d40d3647/classes/kohana/request.php).

Method URL::Site -> URL::base need second parametr BOOLEAN, not a string!

Updated by TJ Krause 3 months ago

Has this issue been solved? If not the fix is quite simple. The third parameter must be a boolean instead of a string for the code in URL:base to work correctly.

Change line 939 in file system/classes/kohana/request.php to the following.

$referrer = URL::site($referrer, TRUE, TRUE);

Change line 945 in file system/classes/kohana/request.php to the following.

$url = URL::site($url, TRUE, TRUE);

Updated by Максим Нагайченко 3 months ago

TJ Krause wrote:

Has this issue been solved? If not the fix is quite simple. The third parameter must be a boolean instead of a string for the code in URL:base to work correctly.

Change line 939 in file system/classes/kohana/request.php to the following.

$referrer = URL::site($referrer, TRUE, TRUE);

Change line 945 in file system/classes/kohana/request.php to the following.

$url = URL::site($url, TRUE, TRUE);

You are right. I also done in my file.

Also available in: Atom PDF