aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2006-12-09 19:17:01 +0000
committerDavid M <davidmj@users.sourceforge.net>2006-12-09 19:17:01 +0000
commit9df6b75f325533fde4c121872a3ce62523ff2312 (patch)
tree3ce004a84fbc74a5ad7f87d3895d8c8cec052a52 /phpBB/includes/functions.php
parent1c41450bd90f86f47521952e7f48339f103b8e5d (diff)
downloadforums-9df6b75f325533fde4c121872a3ce62523ff2312.tar
forums-9df6b75f325533fde4c121872a3ce62523ff2312.tar.gz
forums-9df6b75f325533fde4c121872a3ce62523ff2312.tar.bz2
forums-9df6b75f325533fde4c121872a3ce62523ff2312.tar.xz
forums-9df6b75f325533fde4c121872a3ce62523ff2312.zip
proper solution to #6114, guarantees $seed lies below 0x7FFFFFFF
git-svn-id: file:///svn/phpbb/trunk@6731 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php6
1 files changed, 2 insertions, 4 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,