diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-09-07 12:51:21 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-09-07 12:51:21 +0000 |
| commit | b2252a974ff10647abed98f268af1ba81b11605c (patch) | |
| tree | b2ca6df031fc3ff9684274e107ee2442d2b10b00 /roundcubemail/program/include | |
| parent | 0618dc9a521d74097207c58f58bb2632aa7b17d5 (diff) | |
- Use faster/secure mt_rand() (#1486094)
git-svn-id: https://svn.roundcube.net/trunk@2932 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
| -rw-r--r-- | roundcubemail/program/include/rcmail.php | 2 | ||||
| -rw-r--r-- | roundcubemail/program/include/session.inc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/roundcubemail/program/include/rcmail.php b/roundcubemail/program/include/rcmail.php index 4624ee194..b148e5168 100644 --- a/roundcubemail/program/include/rcmail.php +++ b/roundcubemail/program/include/rcmail.php @@ -879,7 +879,7 @@ class rcmail $key = $this->task; if (!$_SESSION['request_tokens'][$key]) - $_SESSION['request_tokens'][$key] = md5(uniqid($key . rand(), true)); + $_SESSION['request_tokens'][$key] = md5(uniqid($key . mt_rand(), true)); return $_SESSION['request_tokens'][$key]; } diff --git a/roundcubemail/program/include/session.inc b/roundcubemail/program/include/session.inc index ee9bb75ab..bd4e2a1ea 100644 --- a/roundcubemail/program/include/session.inc +++ b/roundcubemail/program/include/session.inc @@ -245,7 +245,7 @@ function rcube_sess_regenerate_id() $randval = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; for ($random = "", $i=1; $i <= 32; $i++) { - $random .= substr($randval, rand(0,(strlen($randval) - 1)), 1); + $random .= substr($randval, mt_rand(0,(strlen($randval) - 1)), 1); } // use md5 value for id or remove capitals from string $randval |
