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,8 +91,10 @@ class Form extends Widget
function sessionToken() function sessionToken()
{ {
if (strtolower($this->method()) == 'post') {
$this->out->hidden('token-' . $this->id() ?: common_random_hexstr(3), common_session_token(), 'token'); $this->out->hidden('token-' . $this->id() ?: common_random_hexstr(3), common_session_token(), 'token');
} }
}
/** /**
* Name of the form * Name of the form

View File

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