diff options
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/functions.php | 6 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_register.php | 6 | ||||
-rw-r--r-- | phpBB/posting.php | 6 |
3 files changed, 6 insertions, 12 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4c417cc03e..9cb5c215b3 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1913,10 +1913,8 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa $confirm_id = md5(unique_id($user->ip)); $seed = hexdec(substr(unique_id(), 4, 10)); - if ($seed > 0x7FFFFFFF) - { - $seed -= 0x7FFFFFFF; - } + // compute $seed % 0x7fffffff + $seed -= 0x7fffffff * floor($seed / 0x7fffffff); $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'confirm_id' => (string) $confirm_id, diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index b4b28e8a1e..39afc8cad7 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -443,10 +443,8 @@ class ucp_register $confirm_id = md5(unique_id($user->ip)); $seed = hexdec(substr(unique_id(), 4, 10)); - if ($seed > 0x7FFFFFFF) - { - $seed -= 0x7FFFFFFF; - } + // compute $seed % 0x7fffffff + $seed -= 0x7fffffff * floor($seed / 0x7fffffff); $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'confirm_id' => (string) $confirm_id, diff --git a/phpBB/posting.php b/phpBB/posting.php index 9b33a9ab62..fbc91b47b9 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1130,10 +1130,8 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'] && $solved_c $confirm_id = md5(unique_id($user->ip)); $seed = hexdec(substr(unique_id(), 4, 10)); - if ($seed > 0x7FFFFFFF) - { - $seed -= 0x7FFFFFFF; - } + // compute $seed % 0x7fffffff + $seed -= 0x7fffffff * floor($seed / 0x7fffffff); $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'confirm_id' => (string) $confirm_id, |