We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit a034e13b authored by Zach Copley's avatar Zach Copley

CSRF protection in emailsettings

parent 2dc50d7e
......@@ -34,6 +34,7 @@ class EmailsettingsAction extends SettingsAction {
'id' => 'emailsettings',
'action' =>
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.'));
if ($this->arg('save')) {
} else if ($this->arg('add')) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment