diff options
author | Jeffery To <jeffery.to@gmail.com> | 2009-12-17 14:38:14 +0800 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-12-18 09:46:15 -0500 |
commit | c17d7b671d245061cf716fe876b5bf7194febddc (patch) | |
tree | 4dccc9a41ef2f801ae1d99af15e4d893146ff16f | |
parent | 8632974131955a74e8c049239050bc0c156b1a5c (diff) |
Set returnto when redirected to login of a private install (for 0.9.x)
Can't use returnToArgs() because we don't have an action object yet.
-rw-r--r-- | index.php | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -278,6 +278,20 @@ function main() && !preg_match('/rss$/', $action) && !preg_match('/^Api/', $action) ) { + // set returnto + $rargs =& common_copy_args($args); + unset($rargs['action']); + if (common_config('site', 'fancy')) { + unset($rargs['p']); + } + if (array_key_exists('submit', $rargs)) { + unset($rargs['submit']); + } + foreach (array_keys($_COOKIE) as $cookie) { + unset($rargs[$cookie]); + } + common_set_returnto(common_local_url($action, $rargs)); + common_redirect(common_local_url('login')); return; } |