diff options
author | Florian Pritz <bluewind@xinu.at> | 2011-06-22 18:04:53 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2011-06-22 18:04:53 +0200 |
commit | fca971e483d270bb6ae84be76513b0e2b5301008 (patch) | |
tree | 39a610f107a8dc270d63f3a1f5dd187a7d160362 | |
parent | c15366c3f66fb41afaacd69d737ab70d63a8d518 (diff) | |
download | aur-fca971e483d270bb6ae84be76513b0e2b5301008.tar.gz aur-fca971e483d270bb6ae84be76513b0e2b5301008.tar.xz |
remove unneeded make_seed()
http://us.php.net/mt_srand
> Note: As of PHP 4.2.0, there is no need to seed the random number
> generator with srand() or mt_srand() as this is now done
> automatically.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | web/lib/aur.inc.php | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php index 32501330..382578c0 100644 --- a/web/lib/aur.inc.php +++ b/web/lib/aur.inc.php @@ -81,25 +81,15 @@ function valid_email($addy) { return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $addy)) ? FALSE : TRUE; } -# a new seed value for mt_srand() -# -function make_seed() { - list($usec, $sec) = explode(' ', microtime()); - return (float) $sec + ((float) $usec * 10000); -} - # generate a (hopefully) unique session id # function new_sid() { - mt_srand(make_seed()); $ts = time(); $pid = getmypid(); - $rand_num = mt_rand(); - mt_srand(make_seed()); $rand_str = substr(md5(mt_rand()),2, 20); - $id = $rand_str . strtolower(md5($ts.$pid)) . $rand_num; + $id = $rand_str . strtolower(md5($ts.$pid)) . mt_rand(); return strtoupper(md5($id)); } |