aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-11-03 11:10:07 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-11-03 11:10:07 +0000
commit61fc9605faa29d1bc5b1be8df2a4ab7f36c92264 (patch)
tree0ee4ae8b718ea253afa73875a53167f1ebf77a39 /phpBB/includes/functions.php
parentce8be416d84953ed39cdf3505d55494c7eb63e5b (diff)
downloadforums-61fc9605faa29d1bc5b1be8df2a4ab7f36c92264.tar
forums-61fc9605faa29d1bc5b1be8df2a4ab7f36c92264.tar.gz
forums-61fc9605faa29d1bc5b1be8df2a4ab7f36c92264.tar.bz2
forums-61fc9605faa29d1bc5b1be8df2a4ab7f36c92264.tar.xz
forums-61fc9605faa29d1bc5b1be8df2a4ab7f36c92264.zip
some changes
git-svn-id: file:///svn/phpbb/trunk@8223 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php22
1 files changed, 6 insertions, 16 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 80a6faceca..5ef95761e0 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -89,7 +89,8 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false)
if ($type == 'array')
{
reset($default);
- list($sub_key_type, $sub_type) = each(current($default));
+ $default = current($default);
+ list($sub_key_type, $sub_type) = each($default);
$sub_type = gettype($sub_type);
$sub_type = ($sub_type == 'array') ? 'NULL' : $sub_type;
$sub_key_type = gettype($sub_key_type);
@@ -269,23 +270,12 @@ function phpbb_hash($password)
$random = '';
$count = 6;
- if (($fh = @fopen('/dev/urandom', 'rb')))
+ for ($i = 0; $i < $count; $i += 16)
{
- $random = fread($fh, $count);
- fclose($fh);
- }
-
- if (strlen($random) < $count)
- {
- $random = '';
-
- for ($i = 0; $i < $count; $i += 16)
- {
- $random_state = md5(unique_id() . $random_state);
- $random .= pack('H*', md5($random_state));
- }
- $random = substr($random, 0, $count);
+ $random_state = md5(unique_id() . $random_state);
+ $random .= pack('H*', md5($random_state));
}
+ $random = substr($random, 0, $count);
$hash = _hash_crypt_private($password, _hash_gensalt_private($random, $itoa64), $itoa64);