]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Set returnto when redirected to login of a private install
authorJeffery To <jeffery.to@gmail.com>
Tue, 11 Aug 2009 13:55:24 +0000 (21:55 +0800)
committerJeffery To <jeffery.to@gmail.com>
Tue, 11 Aug 2009 13:55:24 +0000 (21:55 +0800)
index.php

index 980b9881b0d79674651d0b570c2a94f9ce7a2b41..e590e217e7286e521a3c59778c7ca80c5f0235f5 100644 (file)
--- 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;
         }