summaryrefslogtreecommitdiff
path: root/inc/actions.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/actions.php')
-rw-r--r--inc/actions.php20
1 files changed, 9 insertions, 11 deletions
diff --git a/inc/actions.php b/inc/actions.php
index 900409a90..1fda0584e 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -558,19 +558,21 @@ function act_export($act){
* @author Adrian Lang <lang@cosmocode.de>
*/
function act_subscription($act){
- if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
- // No post to handle, let tpl_subscribe manage the request.
- return $act;
- }
+ global $lang;
+ global $INFO;
+ global $ID;
- // Get and preprocess data.
+ // get and preprocess data.
$params = array();
foreach(array('target', 'style', 'action') as $param) {
- if (isset($_POST["subscribe_$param"])) {
- $params[$param] = $_POST["subscribe_$param"];
+ if (isset($_REQUEST["sub_$param"])) {
+ $params[$param] = $_REQUEST["sub_$param"];
}
}
+ // any action given? if not just return and show the subscription page
+ if(!$params['action']) return $act;
+
// Handle POST data, may throw exception.
trigger_event('ACTION_HANDLE_SUBSCRIBE', $params, 'subscription_handle_post');
@@ -579,9 +581,6 @@ function act_subscription($act){
$data = $params['data'];
$action = $params['action'];
- global $lang;
- global $INFO;
-
// Perform action.
require_once DOKU_INC . 'inc/subscription.php';
if (!subscription_set($_SERVER['REMOTE_USER'], $target, $style, $data)) {
@@ -591,7 +590,6 @@ function act_subscription($act){
}
msg(sprintf($lang["subscr_{$action}_success"], hsc($INFO['userinfo']['name']),
prettyprint_id($target)), 1);
- global $ID;
act_redirect($ID, $act);
// Assure that we have valid data if act_redirect somehow fails.