aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-07-12 07:08:21 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-07-12 07:08:21 +0000
commitf27d0c466e54e95aa1400e0435b78a8f7465256f (patch)
tree9e71b45fb9089a9b18d007cd0ed1ace40de46f73
parent49cc38ebba21dc8b26240a87a23f1d422dd74472 (diff)
downloadforums-f27d0c466e54e95aa1400e0435b78a8f7465256f.tar
forums-f27d0c466e54e95aa1400e0435b78a8f7465256f.tar.gz
forums-f27d0c466e54e95aa1400e0435b78a8f7465256f.tar.bz2
forums-f27d0c466e54e95aa1400e0435b78a8f7465256f.tar.xz
forums-f27d0c466e54e95aa1400e0435b78a8f7465256f.zip
basically what is listed within the changelog. ;)
git-svn-id: file:///svn/phpbb/trunk@7872 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/docs/CHANGELOG.html3
-rw-r--r--phpBB/includes/acp/acp_language.php24
-rw-r--r--phpBB/includes/acp/acp_styles.php6
-rw-r--r--phpBB/install/install_update.php5
-rw-r--r--phpBB/styles/prosilver/template/viewforum_body.html2
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_body.html8
-rw-r--r--phpBB/styles/subsilver2/template/viewforum_body.html17
-rw-r--r--phpBB/styles/subsilver2/template/viewtopic_body.html4
-rw-r--r--phpBB/viewforum.php4
-rw-r--r--phpBB/viewtopic.php4
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 {
<li>[Fix] Allow link forums being password protected (Bug #12967)</li>
<li>[Fix] Allow wrapping topic/post icons in posting editor (Bug #12843)</li>
<li>[Fix] Display L_RANK only once in template if rank title and image defined (Bug #13231)</li>
+ <li>[Fix] Make sure selected transfer method exists before calling (Bug #13265)</li>
+ <li>[Fix] Correctly escape language keys in language editor (Bug #13279)</li>
+ <li>[Fix] Correctly hide post/reply buttons if permissions are not given (related to Bug #12809)</li>
</ul>
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 @@
<!-- ENDIF -->
<!-- BEGINELSE -->
- <!-- IF S_IS_POSTABLE -->
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<strong>{L_NO_TOPICS}</strong>
<span class="corners-bottom"><span></span></span></div>
</div>
- <!-- ENDIF -->
<!-- END topicrow -->
<!-- IF S_SELECT_SORT_DAYS and not S_DISPLAY_ACTIVE -->
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 @@
<div class="topic-actions">
<div class="buttons">
- <!-- IF not S_IS_BOT -->
- <!-- IF U_POST_REPLY_TOPIC or S_IS_POSTABLE --><div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->"><a href="{U_POST_REPLY_TOPIC}"><span><!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF --></span></a></div><!-- ENDIF -->
+ <!-- IF not S_IS_BOT and U_POST_REPLY_TOPIC -->
+ <div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->"><a href="{U_POST_REPLY_TOPIC}"><span><!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF --></span></a></div>
<!-- ENDIF -->
</div>
@@ -237,8 +237,8 @@
<div class="topic-actions">
<div class="buttons">
- <!-- IF not S_IS_BOT -->
- <!-- IF U_POST_REPLY_TOPIC or S_IS_POSTABLE --><div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->"><a href="{U_POST_REPLY_TOPIC}"><span><!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF --></span></a></div><!-- ENDIF -->
+ <!-- IF not S_IS_BOT and U_POST_REPLY_TOPIC -->
+ <div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->"><a href="{U_POST_REPLY_TOPIC}"><span><!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF --></span></a></div>
<!-- ENDIF -->
</div>
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 @@
</table>
<!-- ENDIF -->
- <!-- IF S_IS_POSTABLE -->
<table class="tablebg" width="100%" cellspacing="1">
<tr>
<td class="cat" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->">
@@ -236,18 +235,22 @@
</tr>
</table>
+ <!-- IF S_IS_POSTABLE or TOTAL_TOPICS -->
<table width="100%" cellspacing="1">
<tr>
- <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle"><!-- IF not S_IS_BOT --><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a><!-- ENDIF --></td>
- <td class="nav" nowrap="nowrap">&nbsp;{PAGE_NUMBER}</td>
- <td class="gensmall" nowrap="nowrap">&nbsp;[ {TOTAL_TOPICS} ]</td>
- <td class="nav" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
+ <!-- IF S_IS_POSTABLE and not S_IS_BOT -->
+ <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle"><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a></td>
+ <!-- ENDIF -->
+ <!-- IF TOTAL_TOPICS -->
+ <td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
+ <td class="gensmall" nowrap="nowrap">&nbsp;[ {TOTAL_TOPICS} ]&nbsp;</td>
+ <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
+ <!-- ENDIF -->
</tr>
</table>
-
- <br clear="all" />
<!-- ENDIF -->
+ <br clear="all" />
</div>
<!-- INCLUDE breadcrumbs.html -->
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 @@
<table width="100%" cellspacing="1">
<tr>
- <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle" nowrap="nowrap"><!-- IF not S_IS_BOT --><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a>&nbsp;<a href="{U_POST_REPLY_TOPIC}">{REPLY_IMG}</a><!-- ENDIF --></td>
+ <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle" nowrap="nowrap"><!-- IF not S_IS_BOT and U_POST_NEW_TOPIC --><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a>&nbsp;<!-- ENDIF --><!-- IF not S_IS_BOT and U_POST_REPLY_TOPIC --><a href="{U_POST_REPLY_TOPIC}">{REPLY_IMG}</a><!-- ENDIF --></td>
<!-- IF TOTAL_POSTS -->
<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
<td class="gensmall" nowrap="nowrap">&nbsp;[ {TOTAL_POSTS} ]&nbsp;</td>
@@ -294,7 +294,7 @@
<table width="100%" cellspacing="1">
<tr>
- <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle" nowrap="nowrap"><!-- IF not S_IS_BOT --><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a>&nbsp;<a href="{U_POST_REPLY_TOPIC}">{REPLY_IMG}</a><!-- ENDIF --></td>
+ <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle" nowrap="nowrap"><!-- IF not S_IS_BOT and U_POST_NEW_TOPIC --><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a>&nbsp;<!-- ENDIF --><!-- IF not S_IS_BOT and U_POST_REPLY_TOPIC --><a href="{U_POST_REPLY_TOPIC}">{REPLY_IMG}</a><!-- ENDIF --></td>
<!-- IF TOTAL_POSTS -->
<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
<td class="gensmall" nowrap="nowrap">&nbsp;[ {TOTAL_POSTS} ]&nbsp;</td>
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&amp;i=main&amp;mode=forum_view", true, $user->session_id) : '',
- 'U_POST_NEW_TOPIC' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&amp;f=' . $forum_id),
+ 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&amp;f=' . $forum_id) : '',
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&amp;$u_sort_param&amp;start=$start"),
'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&amp;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 . '&amp;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&amp;f=$forum_id"),
- 'U_POST_REPLY_TOPIC' => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&amp;f=$forum_id&amp;t=$topic_id"),
+ 'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=post&amp;f=$forum_id") : '',
+ 'U_POST_REPLY_TOPIC' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&amp;f=$forum_id&amp;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&amp;f=$forum_id&amp;t=$topic_id") : '')
);