Only POST Form widgets send a session token.

This commit is contained in:
Mikael Nordfeldth 2014-05-18 20:19:05 +02:00
parent bfaa700763
commit d56d97a439
2 changed files with 3 additions and 6 deletions

View File

@ -91,7 +91,9 @@ class Form extends Widget
function sessionToken()
{
$this->out->hidden('token-' . $this->id() ?: common_random_hexstr(3), common_session_token(), 'token');
if (strtolower($this->method()) == 'post') {
$this->out->hidden('token-' . $this->id() ?: common_random_hexstr(3), common_session_token(), 'token');
}
}
/**

View File

@ -106,9 +106,4 @@ class SearchForm extends Form
{
return 'get';
}
function sessionToken()
{
return;
}
}