From 61fc9605faa29d1bc5b1be8df2a4ab7f36c92264 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 3 Nov 2007 11:10:07 +0000 Subject: some changes git-svn-id: file:///svn/phpbb/trunk@8223 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 22 ++++++---------------- phpBB/includes/mcp/mcp_front.php | 8 ++++++++ phpBB/includes/mcp/mcp_reports.php | 2 +- 3 files changed, 15 insertions(+), 17 deletions(-) (limited to 'phpBB/includes') 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); diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index d67a51cd89..707fe22685 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -73,6 +73,14 @@ function mcp_front_view($id, $mode, $action) } $db->sql_freeresult($result); + if (empty($post_list)) + { + $total = 0; + } + } + + if ($total) + { $sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.username, u.username_clean, t.topic_id, t.topic_title, t.topic_first_post_id, p.forum_id FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u WHERE ' . $db->sql_in_set('p.post_id', $post_list) . ' diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 0faa1dc8b7..37ea7e5132 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -599,7 +599,7 @@ function close_report($report_id_list, $mode, $action) } } - foreach($post_info as $post) + foreach ($post_info as $post) { $forum_ids[$post['forum_id']] = $post['forum_id']; $topic_ids[$post['topic_id']] = $post['topic_id']; -- cgit v1.2.1