]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - index.php
Revert "Return a 404 when a page is request that has no notices"
[quix0rs-gnu-social.git] / index.php
index 214f922456e0734367e56697a9346ae38a431225..be62fe1f344561f87893d6e46ea1bf6ff8d5bf1d 100644 (file)
--- a/index.php
+++ b/index.php
@@ -194,6 +194,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;
         }