]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/subscribe.php
Twitter integration - support for new foreign_link table and prefs now save/update
[quix0rs-gnu-social.git] / actions / subscribe.php
index f37095c1c649b98a9b587b4a88aaf6ef6a5214a2..b93c06f120f0f50b084584acaa8d5688606275c0 100644 (file)
@@ -20,6 +20,7 @@
 if (!defined('LACONICA')) { exit(1); }
 
 class SubscribeAction extends Action {
+       
        function handle($args) {
                parent::handle($args);
 
@@ -35,6 +36,15 @@ 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');
 
                $other = User::staticGet('nickname', $other_nickname);