]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Set returnto when redirected to login of a private install (for 0.9.x)
authorJeffery To <jeffery.to@gmail.com>
Thu, 17 Dec 2009 06:38:14 +0000 (14:38 +0800)
committerCraig Andrews <candrews@integralblue.com>
Fri, 18 Dec 2009 14:46:15 +0000 (09:46 -0500)
Can't use returnToArgs() because we don't have an action object yet.

index.php

index 997ee6197f27a1b55e222dc932def5f24a4dbd79..47cde87409b62a31146d553d4e8582bdfd7acb13 100644 (file)
--- 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;
     }