Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect does not append base path for non-absolute URLs #12

Closed
ivanhoe123 opened this issue Jul 16, 2012 · 2 comments
Closed

Redirect does not append base path for non-absolute URLs #12

ivanhoe123 opened this issue Jul 16, 2012 · 2 comments

Comments

@ivanhoe123
Copy link

Hi Mike,

Redirect does not append base path for non-absolute URLs, so when you use Flight::redirect('somewhere'); and your installation is not in root, it won't redirect properly.

This is the fix - Flight.php, line 367:
(I don't know how to send differently, new to Github)

public static function _redirect($url, $code = 303) {
    // If this is not an absolute URL, add the base path
    if (!strpos($url, '//') || strpos($url, 'http://')) {
        $url = self::request()->base.'/'.$url;
    }
   (...)

Btw, thanks for such a cool framework :)

Cheers

@mikecao
Copy link
Collaborator

mikecao commented Jul 19, 2012

Thanks for reporting this. It is now fixed in the latest commit, fc10a50.

@mikecao mikecao closed this as completed Jul 19, 2012
@ivanhoe123
Copy link
Author

I notice now that I double check the same thing; checking just the double slashes should be enough.

Thanks for adding this

antonlazarchenko referenced this issue in antonlazarchenko/flight Feb 11, 2013
SessionDbHandler.php added. Changed configuration parameters and refactoring according do addition SessionDbHandler.php. README.md updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants