From cb3f9dbab0cf12b2a7486cca0de17c47399633f3 Mon Sep 17 00:00:00 2001
From: Adrian Lang <lang@cosmocode.de>
Date: Mon, 30 Nov 2009 10:36:42 +0100
Subject: [PATCH] Add redirect after successful subscription

darcs-hash:20091130093642-e4919-318eed562f0e7777d342dfbe4c8fc352eee58ddf.gz
---
 inc/actions.php | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/inc/actions.php b/inc/actions.php
index e61b1add3..900409a90 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -589,10 +589,14 @@ function act_subscription($act){
                                     hsc($INFO['userinfo']['name']),
                                     prettyprint_id($target)));
     }
-    $INFO['subscribed'] = get_info_subscribed();
     msg(sprintf($lang["subscr_{$action}_success"], hsc($INFO['userinfo']['name']),
                 prettyprint_id($target)), 1);
-    return $act;
+    global $ID;
+    act_redirect($ID, $act);
+
+    // Assure that we have valid data if act_redirect somehow fails.
+    $INFO['subscribed'] = get_info_subscribed();
+    return 'show';
 }
 
 /**
-- 
GitLab