forked from GNUsocial/gnu-social
Making FormAction subclasses use same sessionToken() code
This commit is contained in:
parent
80fbec173b
commit
22481b1de6
@ -84,18 +84,6 @@ class DisfavorForm extends Form
|
||||
return common_local_url('disfavor');
|
||||
}
|
||||
|
||||
/**
|
||||
* Include a session token for CSRF protection
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function sessionToken()
|
||||
{
|
||||
$this->out->hidden('token-' . $this->notice->id,
|
||||
common_session_token(),
|
||||
'token');
|
||||
}
|
||||
|
||||
/**
|
||||
* Legend of the Form
|
||||
*
|
||||
|
@ -84,18 +84,6 @@ class FavorForm extends Form
|
||||
return common_local_url('favor');
|
||||
}
|
||||
|
||||
/**
|
||||
* Include a session token for CSRF protection
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function sessionToken()
|
||||
{
|
||||
$this->out->hidden('token-' . $this->notice->id,
|
||||
common_session_token(),
|
||||
'token');
|
||||
}
|
||||
|
||||
/**
|
||||
* Legend of the Form
|
||||
*
|
||||
|
@ -91,7 +91,7 @@ class Form extends Widget
|
||||
|
||||
function sessionToken()
|
||||
{
|
||||
$this->out->hidden('token', common_session_token());
|
||||
$this->out->hidden('token-' . $this->id() ?: common_random_hexstr(3), common_session_token(), 'token');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -80,17 +80,6 @@ class RepeatForm extends Form
|
||||
return common_local_url('repeat');
|
||||
}
|
||||
|
||||
/**
|
||||
* Include a session token for CSRF protection
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function sessionToken()
|
||||
{
|
||||
$this->out->hidden('token-' . $this->notice->id,
|
||||
common_session_token());
|
||||
}
|
||||
|
||||
/**
|
||||
* Legend of the Form
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user