summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/index.php b/index.php
index 997ee6197..47cde8740 100644
--- a/index.php
+++ b/index.php
@@ -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;
}