Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge branch 'feature/rand-refactor' of https://github.com/denixport/zf2
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Jul 24, 2012
2 parents fbcfdf2 + 5ac668d commit 118612c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Csrf.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace Zend\Validator;

use Traversable;
use Zend\Math\Rand;
use Zend\Session\Container as SessionContainer;
use Zend\Stdlib\ArrayUtils;

Expand Down Expand Up @@ -285,12 +286,7 @@ protected function generateHash()
if (isset(static::$hashCache[$this->getSessionName()])) {
$this->hash = static::$hashCache[$this->getSessionName()];
} else {
$this->hash = md5(
mt_rand(1,1000000)
. $this->getSalt()
. $this->getName()
. mt_rand(1,1000000)
);
$this->hash = md5($this->getSalt() . Rand::getBytes(32) . $this->getName());
static::$hashCache[$this->getSessionName()] = $this->hash;
}
$this->setValue($this->hash);
Expand Down

0 comments on commit 118612c

Please sign in to comment.