From 48ba841be0abf6b44211826101334d1dafb93dd2 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 17 Mar 2011 23:01:07 +0100 Subject: [PATCH] [ticket/10100] Update rand_seed_last_update before rand_seed in unique_id(). Update $config['rand_seed_last_update'] before updating $config['rand_seed'] in unique_id() to mitigate a race condition and unnecessary updates on heavily busy boards. PHPBB3-10100 --- phpBB/includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 2fc7ca6903..198e429afc 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -240,8 +240,8 @@ function unique_id($extra = 'c') if ($dss_seeded !== true && ($config['rand_seed_last_update'] < time() - rand(1,10))) { - set_config('rand_seed', $config['rand_seed'], true); set_config('rand_seed_last_update', time(), true); + set_config('rand_seed', $config['rand_seed'], true); $dss_seeded = true; }