X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Femailsettings.php;h=c93cbfae0d74e423cd54ba4c1441f3d177abe06a;hb=f7865b1d410e303bb5dc2549d12823f37149b8e5;hp=5e2c06bbd3c90c8b3270e76ce57038d1b171fb91;hpb=a4fa34cecbd038fb2cc323aefd2b32739aaee7d5;p=quix0rs-gnu-social.git diff --git a/actions/emailsettings.php b/actions/emailsettings.php index 5e2c06bbd3..c93cbfae0d 100644 --- a/actions/emailsettings.php +++ b/actions/emailsettings.php @@ -34,6 +34,7 @@ class EmailsettingsAction extends SettingsAction { 'id' => 'emailsettings', 'action' => common_local_url('emailsettings'))); + common_hidden('token', common_session_token()); common_element('h2', NULL, _('Address')); @@ -114,6 +115,13 @@ class EmailsettingsAction extends SettingsAction { function handle_post() { + # 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; + } + if ($this->arg('save')) { $this->save_preferences(); } else if ($this->arg('add')) {