summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Eames <grahamje@users.sourceforge.net>2006-04-09 16:17:28 +0000
committerGraham Eames <grahamje@users.sourceforge.net>2006-04-09 16:17:28 +0000
commit541b344ba1276214b08b006a35ae4f5b27d86dcb (patch)
tree9f0d50314959bbe5847aca7e6bca9458064bafdb
parentA couple of items that seem to be missing from CVS (diff)
downloadphpbb-541b344ba1276214b08b006a35ae4f5b27d86dcb.tar.gz
phpbb-541b344ba1276214b08b006a35ae4f5b27d86dcb.tar.bz2
phpbb-541b344ba1276214b08b006a35ae4f5b27d86dcb.zip
Some changes to deal with a potential problem the new random number generator code has with mysql5
git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@5777 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/includes/functions.php2
-rw-r--r--phpBB/includes/usercp_register.php2
-rw-r--r--phpBB/profile.php2
3 files changed, 3 insertions, 3 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 46de501584..02b22df225 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -168,7 +168,7 @@ function dss_rand()
$dss_seeded = true;
}
- return substr($val, 16);
+ return substr($val, 4, 16);
}
//
// Get Userdata, $user can be username or user_id. If force_str is true, the username will be forced.
diff --git a/phpBB/includes/usercp_register.php b/phpBB/includes/usercp_register.php
index 56b789e2db..f45ce50eda 100644
--- a/phpBB/includes/usercp_register.php
+++ b/phpBB/includes/usercp_register.php
@@ -991,7 +991,7 @@ else
// Generate the required confirmation code
// NB 0 (zero) could get confused with O (the letter) so we make change it
$code = dss_rand();
- $code = strtoupper(str_replace('0', 'o', substr($code, 6)));
+ $code = strtoupper(str_replace('0', 'o', substr($code, 2, 6)));
$confirm_id = md5(uniqid($user_ip));
diff --git a/phpBB/profile.php b/phpBB/profile.php
index f03d773fc2..5fbe60d536 100644
--- a/phpBB/profile.php
+++ b/phpBB/profile.php
@@ -62,7 +62,7 @@ function gen_rand_string($hash)
{
$rand_str = dss_rand();
- return ( $hash ) ? md5($rand_str) : substr($rand_str, 8);
+ return ( $hash ) ? md5($rand_str) : substr($rand_str, 0, 8);
}
//
// End page specific functions