`redirect_to` bug with multiple parameters
Reported by Fabrice Luraine | July 24th, 2009 @ 06:47 PM | in Release 0.4 - Fresh Mint And Ginger
redirect_to
should work with multiple parameters
like url_for()
does.
easy to fix
function redirect_to($params)
{
# [NOTE]: (from php.net) HTTP/1.1 requires an absolute URI as argument to » Location:
# including the scheme, hostname and absolute path, but some clients accept
# relative URIs. You can usually use $_SERVER['HTTP_HOST'],
# $_SERVER['PHP_SELF'] and dirname() to make an absolute URI from a relative
# one yourself.
# TODO make absolute uri
if(!headers_sent())
{
$params = func_get_args(); // adding this allow multiple parameters like in url_for
$uri = call_user_func_array('url_for', $params);
stop_and_exit(false);
header('Location: '.$uri);
exit;
}
}
Comments and changes to this ticket
-
Fabrice Luraine July 31st, 2009 @ 06:44 PM
- State changed from new to resolved
(from [ec1b3c41f9267d9affc3ef5b4be61585e52292bf]) Fixing redirect_to bug with multiple parameters [#17 state:resolved] http://github.com/sofadesign/limonade/commit/ec1b3c41f9267d9affc3ef...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Limonade is a PHP micro-framework.
People watching this ticket
Referenced by
- 17 `redirect_to` bug with multiple parameters (from [ec1b3c41f9267d9affc3ef5b4be61585e52292bf]) Fixing ...