1
0
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:
Ryan Cramer
2019-04-05 15:01:49 -04:00
parent c58d00863a
commit d4ca0d6e45

View File

@@ -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;