mirror of
https://github.com/processwire/processwire.git
synced 2025-08-16 19:54:24 +02:00
Update SessionCSRF to use more purpose-specific WireRandom class rather than Password class for random string generation
This commit is contained in:
@@ -70,8 +70,8 @@ class SessionCSRF extends Wire {
|
||||
$tokenValue = $this->session->get($this, $tokenName);
|
||||
if(empty($tokenValue)) {
|
||||
// $tokenValue = md5($this->page->path() . mt_rand() . microtime()) . md5($this->page->name . $this->config->userAuthSalt . mt_rand());
|
||||
$pass = $this->wire(new Password());
|
||||
$tokenValue = $pass->randomBase64String(32);
|
||||
$rand = new WireRandom();
|
||||
$tokenValue = $rand->base64(32);
|
||||
$this->session->set($this, $tokenName, $tokenValue);
|
||||
}
|
||||
return $tokenValue;
|
||||
|
Reference in New Issue
Block a user