diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-02-09 14:24:34 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-02-09 14:24:34 +0000 |
commit | 7216ffe8be85a58eedb4f1e7fe2278a89110be9d (patch) | |
tree | 0991b1d26b268f0a97a54cdea6edad9c0708daab /phpBB/includes | |
parent | 56a93bdfdddde618fe826c23c9151086f9540860 (diff) | |
download | forums-7216ffe8be85a58eedb4f1e7fe2278a89110be9d.tar forums-7216ffe8be85a58eedb4f1e7fe2278a89110be9d.tar.gz forums-7216ffe8be85a58eedb4f1e7fe2278a89110be9d.tar.bz2 forums-7216ffe8be85a58eedb4f1e7fe2278a89110be9d.tar.xz forums-7216ffe8be85a58eedb4f1e7fe2278a89110be9d.zip |
some fixes to be committed.
git-svn-id: file:///svn/phpbb/trunk@6975 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_prune.php | 8 | ||||
-rw-r--r-- | phpBB/includes/functions_convert.php | 27 | ||||
-rw-r--r-- | phpBB/includes/functions_upload.php | 15 | ||||
-rw-r--r-- | phpBB/includes/session.php | 2 |
4 files changed, 29 insertions, 23 deletions
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 851671e36d..9e680e4714 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -219,6 +219,11 @@ class acp_prune $active = ($active) ? explode('-', $active) : array(); $joined = ($joined) ? explode('-', $joined) : array(); + if ((sizeof($active) && sizeof($active) != 3) || (sizeof($joined) && sizeof($joined) != 3)) + { + trigger_error($user->lang['WRONG_ACTIVE_JOINED_DATE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + $count = request_var('count', 0); $key_match = array('lt' => '<', 'gt' => '>', 'eq' => '='); @@ -257,7 +262,8 @@ class acp_prune while ($row = $db->sql_fetchrow($result)) { - if (!in_array($row['user_id'], $bot_ids)) + // Do not prune bots and the user currently pruning. + if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids)) { $user_ids[] = $row['user_id']; $usernames[$row['user_id']] = $row['username']; diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 01ca16d1e8..a0b8740a7d 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -34,10 +34,10 @@ function still_on_time() // If zero, then set to something higher to not let the user catch the ten seconds barrier. if ($max_execution_time === 0) { - $max_execution_time = 65; + $max_execution_time = 250; } - $max_execution_time = min(max(10, ($max_execution_time - 15)), 50); + $max_execution_time = min(max(10, ($max_execution_time - 15)), 250); // For debugging purposes // $max_execution_time = 10; @@ -439,7 +439,8 @@ function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false if (is_dir($src_path)) { - copy_dir($convert->convertor['avatar_gallery_path'], path($config['avatar_gallery_path']) . $gallery_name, !$subdirs_as_galleries, false, true, $relative_path); + // Do not die on failure... safe mode restrictions may be in effect. + copy_dir($convert->convertor['avatar_gallery_path'], path($config['avatar_gallery_path']) . $gallery_name, !$subdirs_as_galleries, false, false, $relative_path); // only doing 1 level deep. (ibf 1.x) // notes: ibf has 2 tiers: directly in the avatar directory for base gallery (handled in the above statement), plus subdirs(handled below). @@ -483,7 +484,9 @@ function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false for ($i = 0; $i < sizeof($dirlist); ++$i) { $dir = $dirlist[$i]; - copy_dir(path($convert->convertor['avatar_gallery_path'], $relative_path) . $dir, path($config['avatar_gallery_path']) . $dir, true, false, true, $relative_path); + + // Do not die on failure... safe mode restrictions may be in effect. + copy_dir(path($convert->convertor['avatar_gallery_path'], $relative_path) . $dir, path($config['avatar_gallery_path']) . $dir, true, false, false, $relative_path); } } } @@ -1927,22 +1930,6 @@ function fix_empty_primary_groups() $db->sql_query('UPDATE ' . USERS_TABLE . ' SET group_id = ' . get_group_id('guests') . ' WHERE user_id = ' . ANONYMOUS); - $sql = 'SELECT ban_userid as user_id FROM ' . BANLIST_TABLE . ' WHERE ban_userid > 0'; - $result = $db->sql_query($sql); - - $user_ids = array(); - while ($row = $db->sql_fetchrow($result)) - { - $user_ids[] = $row['user_id']; - } - $db->sql_freeresult($result); - - if (sizeof($user_ids)) - { - $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_type = ' . USER_IGNORE . ' - WHERE user_id IN (' . implode(',', $user_ids) . ')'); - } - $sql = 'SELECT user_id FROM ' . USER_GROUP_TABLE . ' WHERE group_id = ' . get_group_id('administrators'); $result = $db->sql_query($sql); diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 3f40a35bb2..1dd40f3f1c 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -561,7 +561,20 @@ class fileupload { $_FILES[$form_name]['name'] = basename($source_file); $_FILES[$form_name]['size'] = 0; - $_FILES[$form_name]['type'] = ''; + $mimetype = ''; + + if (function_exists('mime_content_type')) + { + $mimetype = mime_content_type($filename); + } + + // Some browsers choke on a mimetype of application/octet-stream + if (!$mimetype || $mimetype == 'application/octet-stream') + { + $mimetype = 'application/octetstream'; + } + + $_FILES[$form_name]['type'] = $mimetype; } else { diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 9121a965fd..71e83fbd11 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -1440,7 +1440,7 @@ class user extends session if (!$this->lang_path) { global $phpbb_root_path, $config; - + $this->lang_path = $phpbb_root_path . 'language/' . $config['default_lang'] . '/'; } |