]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/subscribe.php
remove 'nudge' -- it won't be in this release
[quix0rs-gnu-social.git] / actions / subscribe.php
index 71452e46ccda236bc06058c4daaabf29b2ee34b0..20c258923bb0b2b33fed38d1d156e27e8cbe155a 100644 (file)
@@ -36,9 +36,19 @@ class SubscribeAction extends Action {
                        return;
                }
 
+               # CSRF protection
+
+               $token = $this->trimmed('token');
+               
+               if (!$token || $token != common_session_token()) {
+                       $this->client_error(_('There was a problem with your session token. Try again, please.'));
+                       return;
+               }
+
                $other_nickname = $this->arg('subscribeto');
 
                $result=subs_subscribe_user($user, $other_nickname);
+               
                if($result != true) {
                        common_user_error($result);
                        return;
@@ -47,5 +57,4 @@ class SubscribeAction extends Action {
                common_redirect(common_local_url('subscriptions', array('nickname' =>
                                                                                                                                $user->nickname)));
        }
-
 }
\ No newline at end of file