X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Finvite.php;h=c7d92085c163faff7999baba8f08186e6ae79e35;hb=2abe10b8ea4b5d69fc7f6513bf465541454ca2cf;hp=8b4346ca90b9ac8beaae1b4b8b464be75592fc91;hpb=9bff7c9a765779c9f5b46d08946d6844f6339ab0;p=quix0rs-gnu-social.git diff --git a/actions/invite.php b/actions/invite.php index 8b4346ca90..c7d92085c1 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -40,6 +40,13 @@ class InviteAction extends Action { function send_invitations() { + # CSRF protection + $token = $this->trimmed('token'); + if (!$token || $token != common_session_token()) { + $this->show_form(_('There was a problem with your session token. Try again, please.')); + return; + } + $user = common_current_user(); $profile = $user->getProfile(); @@ -125,6 +132,7 @@ class InviteAction extends Action { common_element_start('form', array('method' => 'post', 'id' => 'invite', 'action' => common_local_url('invite'))); + common_hidden('token', common_session_token()); common_textarea('addresses', _('Email addresses'), $this->trimmed('addresses'),