From f27d0c466e54e95aa1400e0435b78a8f7465256f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 12 Jul 2007 07:08:21 +0000 Subject: [PATCH] basically what is listed within the changelog. ;) git-svn-id: file:///svn/phpbb/trunk@7872 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 3 +++ phpBB/includes/acp/acp_language.php | 24 ++++++++++++++----- phpBB/includes/acp/acp_styles.php | 6 ++--- phpBB/install/install_update.php | 5 ++++ .../prosilver/template/viewforum_body.html | 2 -- .../prosilver/template/viewtopic_body.html | 8 +++---- .../subsilver2/template/viewforum_body.html | 17 +++++++------ .../subsilver2/template/viewtopic_body.html | 4 ++-- phpBB/viewforum.php | 4 ++-- phpBB/viewtopic.php | 4 ++-- 10 files changed, 49 insertions(+), 28 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 04868c7f0d..a023137ee2 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -211,6 +211,9 @@ p a {
  • [Fix] Allow link forums being password protected (Bug #12967)
  • [Fix] Allow wrapping topic/post icons in posting editor (Bug #12843)
  • [Fix] Display L_RANK only once in template if rank title and image defined (Bug #13231)
  • +
  • [Fix] Make sure selected transfer method exists before calling (Bug #13265)
  • +
  • [Fix] Correctly escape language keys in language editor (Bug #13279)
  • +
  • [Fix] Correctly hide post/reply buttons if permissions are not given (related to Bug #12809)
  • diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 03ab523d7c..607bbd3cac 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -93,6 +93,11 @@ class acp_language $method = request_var('method', ''); + if (!class_exists($method)) + { + trigger_error('Method does not exist.', E_USER_ERROR); + } + $requested_data = call_user_func(array($method, 'data')); foreach ($requested_data as $data => $default) { @@ -201,7 +206,7 @@ class acp_language // Get target filename for storage folder $filename = $this->get_filename($row['lang_iso'], $this->language_directory, $this->language_file, true, true); - $fp = fopen($phpbb_root_path . $filename, 'wb'); + $fp = @fopen($phpbb_root_path . $filename, 'wb'); if (!$fp) { @@ -271,7 +276,7 @@ class acp_language header('Content-Type: application/octetstream; name="' . $this->language_file . '"'); header('Content-disposition: attachment; filename=' . $this->language_file); - $fp = fopen($phpbb_root_path . $filename, 'rb'); + $fp = @fopen($phpbb_root_path . $filename, 'rb'); while ($buffer = fread($fp, 1024)) { echo $buffer; @@ -329,7 +334,10 @@ class acp_language $transfer->close_session(); // Remove from storage folder - @unlink($phpbb_root_path . 'store/' . $lang_path . $file); + if (file_exists($phpbb_root_path . 'store/' . $lang_path . $file)) + { + @unlink($phpbb_root_path . 'store/' . $lang_path . $file); + } add_log('admin', 'LOG_LANGUAGE_FILE_REPLACED', $file); @@ -406,7 +414,11 @@ class acp_language if (isset($_POST['remove_store'])) { $store_filename = $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true); - @unlink($phpbb_root_path . $store_filename); + + if (file_exists($phpbb_root_path . $store_filename)) + { + @unlink($phpbb_root_path . $store_filename); + } } include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx); @@ -1323,12 +1335,12 @@ $lang = array_merge($lang, array( if (!is_array($value)) { - $entry .= "{$tabs}'{$key}'\t=> '" . $this->prepare_lang_entry($value) . "',\n"; + $entry .= "{$tabs}'" . $this->prepare_lang_entry($key) . "'\t=> '" . $this->prepare_lang_entry($value) . "',\n"; } else { $_tabs = $tabs . "\t"; - $entry .= "\n{$tabs}'{$key}'\t=> array(\n"; + $entry .= "\n{$tabs}'" . $this->prepare_lang_entry($key) . "'\t=> array(\n"; foreach ($value as $_key => $_value) { diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index db5bca1ba6..b0c2c5465d 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -700,7 +700,7 @@ parse_css_file = {PARSE_CSS_FILE} // If the template is stored on the filesystem try to write the file else store it in the database if (!$safe_mode && !$template_info['template_storedb'] && file_exists($file) && @is_writable($file)) { - if (!($fp = fopen($file, 'wb'))) + if (!($fp = @fopen($file, 'wb'))) { trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING); } @@ -1055,7 +1055,7 @@ parse_css_file = {PARSE_CSS_FILE} // If the theme is stored on the filesystem try to write the file else store it in the database if (!$safe_mode && !$theme_info['theme_storedb'] && file_exists($file) && @is_writable($file)) { - if (!($fp = fopen($file, 'wb'))) + if (!($fp = @fopen($file, 'wb'))) { trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING); } @@ -2344,7 +2344,7 @@ parse_css_file = {PARSE_CSS_FILE} { foreach ($file_ary as $file) { - if (!($fp = fopen("{$phpbb_root_path}styles/$template_path$pathfile$file", 'r'))) + if (!($fp = @fopen("{$phpbb_root_path}styles/$template_path$pathfile$file", 'r'))) { trigger_error("Could not open {$phpbb_root_path}styles/$template_path$pathfile$file", E_USER_ERROR); } diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 9bf475abfa..7c8e965b83 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -643,6 +643,11 @@ class install_update extends module { $this->page_title = 'SELECT_FTP_SETTINGS'; + if (!class_exists($method)) + { + trigger_error('Method does not exist.', E_USER_ERROR); + } + $requested_data = call_user_func(array($method, 'data')); foreach ($requested_data as $data => $default) { diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index 6845736c2e..bc89861575 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -159,13 +159,11 @@ -
    {L_NO_TOPICS}
    - diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 58d1f1a780..ac3703a514 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -31,8 +31,8 @@
    @@ -237,8 +237,8 @@
    diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html index 6aa444d20e..e328552cde 100644 --- a/phpBB/styles/subsilver2/template/viewforum_body.html +++ b/phpBB/styles/subsilver2/template/viewforum_body.html @@ -148,7 +148,6 @@ -
    @@ -236,18 +235,22 @@
    + - - - - + + + + + + + +
    {POST_IMG} [ {TOTAL_TOPICS} ]{POST_IMG} [ {TOTAL_TOPICS} ] 
    - -
    +
    diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html index 434bb6ce26..0fe28f3509 100644 --- a/phpBB/styles/subsilver2/template/viewtopic_body.html +++ b/phpBB/styles/subsilver2/template/viewtopic_body.html @@ -31,7 +31,7 @@ - + @@ -294,7 +294,7 @@
    {POST_IMG} {REPLY_IMG}{POST_IMG} {REPLY_IMG}  [ {TOTAL_POSTS} ] 
    - + diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index e2fbc1db40..7884896a9f 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -275,7 +275,7 @@ $template->assign_vars(array( 'L_NO_TOPICS' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['POST_FORUM_LOCKED'] : $user->lang['NO_TOPICS'], - 'S_IS_POSTABLE' => ($forum_data['forum_type'] == FORUM_POST) ? true : false, + 'S_IS_POSTABLE' => ($forum_data['forum_type'] == FORUM_POST && $auth->acl_get('f_post', $forum_id)) ? true : false, 'S_DISPLAY_ACTIVE' => $s_display_active, 'S_SELECT_SORT_DIR' => $s_sort_dir, 'S_SELECT_SORT_KEY' => $s_sort_key, @@ -290,7 +290,7 @@ $template->assign_vars(array( 'S_SINGLE_MODERATOR' => (!empty($moderators[$forum_id]) && sizeof($moderators[$forum_id]) > 1) ? false : true, 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&i=main&mode=forum_view", true, $user->session_id) : '', - 'U_POST_NEW_TOPIC' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&f=' . $forum_id), + 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&f=' . $forum_id) : '', 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&$u_sort_param&start=$start"), 'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&mark=topics") : '', )); diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 2f6aac1fc6..6d21041e8a 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -581,8 +581,8 @@ $template->assign_vars(array( 'U_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks']) ? $viewtopic_url . '&bookmark=1' : '', 'L_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'], - 'U_POST_NEW_TOPIC' => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=post&f=$forum_id"), - 'U_POST_REPLY_TOPIC' => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&f=$forum_id&t=$topic_id"), + 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=post&f=$forum_id") : '', + 'U_POST_REPLY_TOPIC' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&f=$forum_id&t=$topic_id") : '', 'U_BUMP_TOPIC' => (bump_topic_allowed($forum_id, $topic_data['topic_bumped'], $topic_data['topic_last_post_time'], $topic_data['topic_poster'], $topic_data['topic_last_poster_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=bump&f=$forum_id&t=$topic_id") : '') );
    {POST_IMG} {REPLY_IMG}{POST_IMG} {REPLY_IMG}  [ {TOTAL_POSTS} ]