mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 23:43:12 +00:00
PHRAS-4038 fix token in form (#4484)
This commit is contained in:
@@ -116,10 +116,12 @@ class Controller
|
|||||||
|
|
||||||
public function setSessionFormToken($formName)
|
public function setSessionFormToken($formName)
|
||||||
{
|
{
|
||||||
$randomValue = bin2hex(random_bytes(35));
|
if (!$this->app['session']->has($formName.'_token')) {
|
||||||
$this->app['session']->set($formName.'_token', $randomValue);
|
$randomValue = bin2hex(random_bytes(35));
|
||||||
|
$this->app['session']->set($formName.'_token', $randomValue);
|
||||||
|
|
||||||
return $randomValue;
|
return $randomValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSessionFormToken($formName)
|
public function getSessionFormToken($formName)
|
||||||
|
Reference in New Issue
Block a user