summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2009-08-11 21:55:24 +0800
committerJeffery To <jeffery.to@gmail.com>2009-08-11 21:55:24 +0800
commite432df76d5a0a342fa1b8cc55bbcd1cbd45b40e8 (patch)
tree40e2623ed02857f77676b0531fe4e72cfd2506a4 /index.php
parent73cde378c9f8d14cb2c4a896813ac6d21299a142 (diff)
Set returnto when redirected to login of a private install
Diffstat (limited to 'index.php')
-rw-r--r--index.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/index.php b/index.php
index 980b9881b..e590e217e 100644
--- a/index.php
+++ b/index.php
@@ -193,6 +193,21 @@ function main()
}
if (!in_array($action, $public_actions) &&
!preg_match('/rss$/', $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_action));
return;
}