mirror of
https://github.com/processwire/processwire.git
synced 2025-08-18 04:22:10 +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);
|
$tokenValue = $this->session->get($this, $tokenName);
|
||||||
if(empty($tokenValue)) {
|
if(empty($tokenValue)) {
|
||||||
// $tokenValue = md5($this->page->path() . mt_rand() . microtime()) . md5($this->page->name . $this->config->userAuthSalt . mt_rand());
|
// $tokenValue = md5($this->page->path() . mt_rand() . microtime()) . md5($this->page->name . $this->config->userAuthSalt . mt_rand());
|
||||||
$pass = $this->wire(new Password());
|
$rand = new WireRandom();
|
||||||
$tokenValue = $pass->randomBase64String(32);
|
$tokenValue = $rand->base64(32);
|
||||||
$this->session->set($this, $tokenName, $tokenValue);
|
$this->session->set($this, $tokenName, $tokenValue);
|
||||||
}
|
}
|
||||||
return $tokenValue;
|
return $tokenValue;
|
||||||
|
Reference in New Issue
Block a user