X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fsubscribe.php;h=8d04934b7d3fb8b6bd7be3b5d499a577d2f40439;hb=f7865b1d410e303bb5dc2549d12823f37149b8e5;hp=71452e46ccda236bc06058c4daaabf29b2ee34b0;hpb=92645bbc578fafeb6816a44b8cf9cd594ffb5bd7;p=quix0rs-gnu-social.git diff --git a/actions/subscribe.php b/actions/subscribe.php index 71452e46cc..8d04934b7d 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -36,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'); $result=subs_subscribe_user($user, $other_nickname);