diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acm/acm_file.php | 15 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_attachments.php | 6 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_groups.php | 11 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_main.php | 3 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_styles.php | 11 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 3 | ||||
-rw-r--r-- | phpBB/includes/functions_messenger.php | 4 | ||||
-rw-r--r-- | phpBB/includes/template.php | 4 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 20 |
9 files changed, 56 insertions, 21 deletions
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index 62d30f8018..e0e99d4153 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -84,6 +84,11 @@ class acm @flock($fp, LOCK_UN); fclose($fp); + if (!function_exists('phpbb_chmod')) + { + include(PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT); + } + phpbb_chmod($this->cache_dir . 'data_global.' . PHP_EXT, CHMOD_WRITE); } else @@ -182,6 +187,11 @@ class acm @flock($fp, LOCK_UN); fclose($fp); + if (!function_exists('phpbb_chmod')) + { + include(PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT); + } + phpbb_chmod($this->cache_dir . "data{$var_name}." . PHP_EXT, CHMOD_WRITE); } } @@ -392,6 +402,11 @@ class acm @flock($fp, LOCK_UN); fclose($fp); + if (!function_exists('phpbb_chmod')) + { + include(PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT); + } + phpbb_chmod($filename, CHMOD_WRITE); $query_result = $query_id; diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 3b53d51417..7b866e3c36 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -768,6 +768,8 @@ class acp_attachments $s_forum_id_options = ''; + /** @todo use in-built function **/ + $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id FROM ' . FORUMS_TABLE . ' ORDER BY left_id ASC'; @@ -798,7 +800,7 @@ class acp_attachments } else if ($row['left_id'] > $right + 1) { - $padding = $padding_store[$row['parent_id']]; + $padding = empty($padding_store[$row['parent_id']]) ? '' : $padding_store[$row['parent_id']]; } $right = $row['right_id']; @@ -1171,7 +1173,7 @@ class acp_attachments $location .= '/'; } - if (@is_readable($location . 'mogrify' . $exe) && @filesize($location . 'mogrify' . $exe) > 3000) + if (@file_exists($location) && @is_readable($location . 'mogrify' . $exe) && @filesize($location . 'mogrify' . $exe) > 3000) { $imagick = str_replace('\\', '/', $location); continue; diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 1680dacfda..cae2c30433 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -87,7 +87,7 @@ class acp_groups // Approve, demote or promote $group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name']; $error = group_user_attributes($action, $group_id, $mark_ary, false, $group_name); - + if (!$error) { switch ($action) @@ -111,7 +111,7 @@ class acp_groups { trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); } - + break; case 'default': @@ -179,7 +179,7 @@ class acp_groups case 'deleteusers': case 'delete': - if (!$group_id) + if (!$group_id) { trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); } @@ -187,6 +187,7 @@ class acp_groups { trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); } + if (confirm_box(true)) { $error = ''; @@ -751,14 +752,14 @@ class acp_groups foreach ($row_ary as $group_id => $row) { $group_name = (!empty($user->lang['G_' . $row['group_name']]))? $user->lang['G_' . $row['group_name']] : $row['group_name']; - + $template->assign_block_vars('groups', array( 'U_LIST' => "{$this->u_action}&action=list&g=$group_id", 'U_EDIT' => "{$this->u_action}&action=edit&g=$group_id", 'U_DELETE' => ($auth->acl_get('a_groupdel')) ? "{$this->u_action}&action=delete&g=$group_id" : '', 'S_GROUP_SPECIAL' => ($row['group_type'] == GROUP_SPECIAL) ? true : false, - + 'GROUP_NAME' => $group_name, 'TOTAL_MEMBERS' => $row['total_members'], ) diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index caaeb31404..3e66f49afa 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -483,7 +483,8 @@ class acp_main if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) && is_writable(PHPBB_ROOT_PATH . 'config.' . PHP_EXT)) { - $template->assign_var('S_WRITABLE_CONFIG', true); + // World-Writable? (000x) + $template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) & 0x0002)); } $this->tpl_name = 'acp_main'; diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index e205b15892..b2389da3d4 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -688,7 +688,7 @@ parse_css_file = {PARSE_CSS_FILE} } fwrite($fp, $template_data); fclose($fp); - + // destroy the cached version of the template (filename without extension) $this->clear_template_cache($template_info, array(substr($template_file, 0, -5))); @@ -826,7 +826,7 @@ parse_css_file = {PARSE_CSS_FILE} trigger_error($user->lang['TEMPLATE_CACHE_CLEARED'] . adm_back_link($this->u_action . "&action=cache&id=$template_id")); } - $cache_prefix = 'tpl_' . $template_row['template_path']; + $cache_prefix = 'tpl_' . str_replace('_', '-', $template_row['template_path']); // Someone wants to see the cached source ... so we'll highlight it, // add line numbers and indent it appropriately. This could be nasty @@ -1638,7 +1638,6 @@ parse_css_file = {PARSE_CSS_FILE} if ($mode == 'template' || $inc_template) { $template_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['template_name'], $style_row['template_copyright'], $config['version']), $this->template_cfg); - $template_cfg .= "\nbbcode_bitfield = {$style_row['bbcode_bitfield']}"; $data[] = array( 'src' => $template_cfg, @@ -2193,7 +2192,7 @@ parse_css_file = {PARSE_CSS_FILE} { global $user; - $cache_prefix = 'tpl_' . $template_path; + $cache_prefix = 'tpl_' . str_replace('_', '-', $template_path); if (!($dp = @opendir(PHPBB_ROOT_PATH . 'cache'))) { @@ -2229,7 +2228,7 @@ parse_css_file = {PARSE_CSS_FILE} { global $user; - $cache_prefix = 'tpl_' . $template_row['template_path']; + $cache_prefix = 'tpl_' . str_replace('_', '-', $template_row['template_path']); if (!$file_ary || !is_array($file_ary)) { @@ -3069,4 +3068,4 @@ parse_css_file = {PARSE_CSS_FILE} } } -?>
\ No newline at end of file +?> diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index eb7d5815a3..e99f70f153 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3547,9 +3547,6 @@ function page_header($page_title = '', $display_online_list = true) 'S_BOARD_DISABLED' => ($config['board_disable']) ? true : false, 'S_REGISTERED_USER' => (!empty($user->data['is_registered'])) ? true : false, 'S_IS_BOT' => (!empty($user->data['is_bot'])) ? true : false, - 'S_IN_SEARCH' => false, - 'S_VIEWTOPIC' => false, - 'S_VIEWFORUM' => false, 'S_USER_PM_POPUP' => $user->optionget('popuppm'), 'S_USER_LANG' => $user_lang, 'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'], diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index de8b031b68..73206839b7 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -691,7 +691,7 @@ class queue if ($fp = @fopen($this->cache_file, 'wb')) { @flock($fp, LOCK_EX); - fwrite($fp, "<?php\n\$this->queue_data = " . var_export($this->queue_data, true) . ";\n?>"); + fwrite($fp, "<?php\n\$this->queue_data = unserialize(" . var_export(serialize($this->queue_data), true) . ");\n\n?>"); @flock($fp, LOCK_UN); fclose($fp); @@ -732,7 +732,7 @@ class queue if ($fp = @fopen($this->cache_file, 'w')) { @flock($fp, LOCK_EX); - fwrite($fp, "<?php\n\$this->queue_data = " . var_export($this->data, true) . ";\n?>"); + fwrite($fp, "<?php\n\$this->queue_data = unserialize(" . var_export(serialize($this->data), true) . ");\n\n?>"); @flock($fp, LOCK_UN); fclose($fp); diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 9e0ff6c02a..814d6d2e50 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -67,7 +67,7 @@ class template public function set_custom_template($template_path, $template_name) { $this->root = $template_path; - $this->cachepath = PHPBB_ROOT_PATH . 'cache/ctpl_' . $template_name . '_'; + $this->cachepath = PHPBB_ROOT_PATH . 'cache/ctpl_' . str_replace('_', '-', $template_name) . '_'; return true; } @@ -174,7 +174,7 @@ class template } else { - // if we could not eval AND the file exists, something horrific has occured + // if we could not eval AND the file exists, something horrific has occured return false; } diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 89cdd5c640..0df9ba2707 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -418,6 +418,26 @@ function compose_pm($id, $mode, $action) $max_recipients = (!$max_recipients) ? $config['pm_max_recipients'] : $max_recipients; + // If this is a quote/reply "to all"... we may increase the max_recpients to the number of original recipients + if (($action == 'reply' || $action == 'quote') && $max_recipients) + { + // We try to include every previously listed member from the TO Header + $list = rebuild_header(array('to' => $post['to_address'])); + + // Can be an empty array too ;) + $list = (!empty($list['u'])) ? $list['u'] : array(); + $list[$post['author_id']] = 'to'; + + if (isset($list[$user->data['user_id']])) + { + unset($list[$user->data['user_id']]); + } + + $max_recipients = ($max_recipients < sizeof($list)) ? sizeof($list) : $max_recipients; + + unset($list); + } + // Handle User/Group adding/removing handle_message_list_actions($address_list, $error, $remove_u, $remove_g, $add_to, $add_bcc); |