aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/passwords/driver/helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/passwords/driver/helper.php')
-rw-r--r--phpBB/phpbb/passwords/driver/helper.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/phpBB/phpbb/passwords/driver/helper.php b/phpBB/phpbb/passwords/driver/helper.php
index da66347ac3..086edb6b65 100644
--- a/phpBB/phpbb/passwords/driver/helper.php
+++ b/phpBB/phpbb/passwords/driver/helper.php
@@ -120,12 +120,13 @@ class helper
* Get random salt with specified length
*
* @param int $length Salt length
+ * @param string $rand_seed Seed for random data (optional). For tests.
*/
- public function get_random_salt($length)
+ public function get_random_salt($length, $rand_seed = '/dev/urandom')
{
$random = '';
- if (($fh = @fopen('/dev/urandom', 'rb')))
+ if (($fh = @fopen($rand_seed, 'rb')))
{
$random = fread($fh, $length);
fclose($fh);