mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: check GetRandom() exists for RandomGenerator
See http://open.silverstripe.org/ticket/6416
This commit is contained in:
parent
23ed5335e6
commit
a4ff1d3613
@ -47,8 +47,10 @@ class RandomGenerator {
|
||||
if($isWin && class_exists('COM')) {
|
||||
try {
|
||||
$comObj = new COM('CAPICOM.Utilities.1');
|
||||
$e = base64_decode($comObj->GetRandom(64, 0));
|
||||
return $e;
|
||||
|
||||
if(is_callable(array($comObj,'GetRandom'))) {
|
||||
return base64_decode($comObj->GetRandom(64, 0));
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
}
|
||||
}
|
||||
@ -66,6 +68,5 @@ class RandomGenerator {
|
||||
*/
|
||||
function generateHash($algorithm = 'whirlpool') {
|
||||
return hash($algorithm, $this->generateEntropy());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user