aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/acp_users_overview.html2
-rw-r--r--phpBB/docs/CHANGELOG.html10
-rw-r--r--phpBB/feed.php44
-rw-r--r--phpBB/includes/acp/acp_language.php4
-rw-r--r--phpBB/includes/acp/acp_styles.php4
-rw-r--r--phpBB/includes/functions.php96
-rw-r--r--phpBB/includes/session.php8
-rw-r--r--phpBB/styles/prosilver/template/mcp_reports.html2
-rw-r--r--phpBB/viewforum.php18
9 files changed, 116 insertions, 72 deletions
diff --git a/phpBB/adm/style/acp_users_overview.html b/phpBB/adm/style/acp_users_overview.html
index d48cfa57be..7d9a0f27d3 100644
--- a/phpBB/adm/style/acp_users_overview.html
+++ b/phpBB/adm/style/acp_users_overview.html
@@ -148,6 +148,6 @@
{S_FORM_TOKEN}
</p>
</fieldset>
- <!-- ENDIF -->
</form>
+ <!-- ENDIF -->
<!-- ENDIF -->
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 3f457efb69..36dc3d037c 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -101,11 +101,21 @@
<li>[Fix] Minor language fixes. (Bug #54855)</li>
<li>[Fix] Parsing urls in signatures properly uses config settings. (Bug #57105)</li>
<li>[Fix] Allow multibyte keys in request_var(). (Bug #51555)</li>
+ <li>[Fix] Fix inclusion check for captcha garbage collection (Bug #59425)</li>
<li>[Fix] Prevent wrong tar archive type detection. (Bug #12531)</li>
<li>[Fix] Correct redirection after login to forum not in web root (Bug #58755)</li>
<li>[Fix] Allow setting parent forums regardless of permission settings. (Bug #57415)</li>
+ <li>[Fix] Redirect search engines that access pages with SIDs in the URL. (Bug #58025)</li>
+ <li>[Fix] Fix incorrect ampersand encoding in redirect parameter. (Bug #58465)</li>
+ <li>[Fix] Fix open_basedir issues when accessing styles- and language-management. (Bug #59135)</li>
+ <li>[Fix] Fix table binding issues with PostgreSQL in board-wide feed. (Bug #58425)</li>
+ <li>[Fix] Only show unapproved posts in ATOM Feeds for moderators (Bug #58695)</li>
+ <li>[Fix] Various XHTML mistakes in ACP (Bug #58745)</li>
+ <li>[Fix] Fix dead link in MCP on reports for global announcements in prosilver. (Bug #9512)</li>
+ <li>[Fix] Fix broken links for reports on active topics, when the topic is in a subforum. (Bug #9047)</li>
<li>[Feature] Support for Microsoft's Native SQL Server Driver for PHP (Bug #57055 - Patch by Chris Pucci at Microsoft)</li>
<li>[Feature] The memcache acm plugin now supports multiple memcache servers.</li>
+ <li>[Feature] Show note for moderators on unapproved posts/topics with unapproved posts in ATOM Feed (Bug #9511)</li>
</ul>
<a name="v307"></a><h3>1.i. Changes since 3.0.7</h3>
diff --git a/phpBB/feed.php b/phpBB/feed.php
index a42aa42a7f..88c30c5d4f 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -535,12 +535,30 @@ class phpbb_feed_base
if (!isset($forum_ids))
{
- $forum_ids = array_keys($auth->acl_getf('m_approve'));
+ $forum_ids = array_keys($auth->acl_getf('m_approve', true));
}
return $forum_ids;
}
+ function is_moderator_approve_forum($forum_id)
+ {
+ static $forum_ids;
+
+ if (!isset($forum_ids))
+ {
+ $forum_ids = array_flip($this->get_moderator_approve_forums());
+ }
+
+ if (!$forum_id)
+ {
+ // Global announcement, your a moderator in any forum than it's okay.
+ return (!empty($forum_ids)) ? true : false;
+ }
+
+ return (isset($forum_ids[$forum_id])) ? true : false;
+ }
+
function get_excluded_forums()
{
global $db, $cache;
@@ -677,7 +695,8 @@ class phpbb_feed_post_base extends phpbb_feed_base
if ($config['feed_item_statistics'])
{
$item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row)
- . ' ' . $this->separator_stats . ' ' . $user->format_date($row['post_time']);
+ . ' ' . $this->separator_stats . ' ' . $user->format_date($row['post_time'])
+ . (($this->is_moderator_approve_forum($row['forum_id']) && !$row['post_approved']) ? ' ' . $this->separator_stats . ' ' . $user->lang['POST_UNAPPROVED'] : '');
}
}
}
@@ -719,8 +738,9 @@ class phpbb_feed_topic_base extends phpbb_feed_base
{
$item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row)
. ' ' . $this->separator_stats . ' ' . $user->format_date($row[$this->get('date')])
- . ' ' . $this->separator_stats . ' ' . $user->lang['REPLIES'] . ' ' . $row['topic_replies']
- . ' ' . $this->separator_stats . ' ' . $user->lang['VIEWS'] . ' ' . $row['topic_views'];
+ . ' ' . $this->separator_stats . ' ' . $user->lang['REPLIES'] . ' ' . (($this->is_moderator_approve_forum($row['forum_id'])) ? $row['topic_replies_real'] : $row['topic_replies'])
+ . ' ' . $this->separator_stats . ' ' . $user->lang['VIEWS'] . ' ' . $row['topic_views']
+ . (($this->is_moderator_approve_forum($row['forum_id']) && ($row['topic_replies_real'] != $row['topic_replies'])) ? ' ' . $this->separator_stats . ' ' . $user->lang['POSTS_UNAPPROVED'] : '');
}
}
}
@@ -780,11 +800,11 @@ class phpbb_feed_overall extends phpbb_feed_post_base
// Get the actual data
$this->sql = array(
'SELECT' => 'f.forum_id, f.forum_name, ' .
- 'p.post_id, p.topic_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
+ 'p.post_id, p.topic_id, p.post_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
'u.username, u.user_id',
'FROM' => array(
- POSTS_TABLE => 'p',
USERS_TABLE => 'u',
+ POSTS_TABLE => 'p',
),
'LEFT_JOIN' => array(
array(
@@ -912,7 +932,7 @@ class phpbb_feed_forum extends phpbb_feed_post_base
}
$this->sql = array(
- 'SELECT' => 'p.post_id, p.topic_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
+ 'SELECT' => 'p.post_id, p.topic_id, p.post_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
'u.username, u.user_id',
'FROM' => array(
POSTS_TABLE => 'p',
@@ -994,7 +1014,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base
if (!$this->topic_data['topic_approved'])
{
// Also require m_approve
- $in_fid_ary = array_intersect($in_fid_ary, array_keys($auth->acl_getf('m_approve')));
+ $in_fid_ary = array_intersect($in_fid_ary, $this->get_moderator_approve_forums());
if (empty($in_fid_ary))
{
@@ -1077,7 +1097,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base
global $auth, $db;
$this->sql = array(
- 'SELECT' => 'p.post_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
+ 'SELECT' => 'p.post_id, p.post_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
'u.username, u.user_id',
'FROM' => array(
POSTS_TABLE => 'p',
@@ -1241,7 +1261,7 @@ class phpbb_feed_news extends phpbb_feed_topic_base
$this->sql = array(
'SELECT' => 'f.forum_id, f.forum_name,
- t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_views, t.topic_time,
+ t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_replies_real, t.topic_views, t.topic_time,
p.post_id, p.post_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url',
'FROM' => array(
TOPICS_TABLE => 't',
@@ -1314,7 +1334,7 @@ class phpbb_feed_topics extends phpbb_feed_topic_base
$this->sql = array(
'SELECT' => 'f.forum_id, f.forum_name,
- t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_views, t.topic_time,
+ t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_replies_real, t.topic_views, t.topic_time,
p.post_id, p.post_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url',
'FROM' => array(
TOPICS_TABLE => 't',
@@ -1412,7 +1432,7 @@ class phpbb_feed_topics_active extends phpbb_feed_topic_base
$this->sql = array(
'SELECT' => 'f.forum_id, f.forum_name,
- t.topic_id, t.topic_title, t.topic_replies, t.topic_views,
+ t.topic_id, t.topic_title, t.topic_replies, t.topic_replies_real, t.topic_views,
t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_post_time,
p.post_id, p.post_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url',
'FROM' => array(
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php
index fedae6fe67..c2cb2f9c11 100644
--- a/phpBB/includes/acp/acp_language.php
+++ b/phpBB/includes/acp/acp_language.php
@@ -1120,12 +1120,12 @@ class acp_language
{
while (($file = readdir($dp)) !== false)
{
- if (!is_dir($phpbb_root_path . 'language/' . $file))
+ if ($file[0] == '.' || !is_dir($phpbb_root_path . 'language/' . $file))
{
continue;
}
- if ($file[0] != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt"))
+ if (file_exists("{$phpbb_root_path}language/$file/iso.txt"))
{
if (!in_array($file, $installed))
{
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index d2a0f9210f..3310560c73 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -643,13 +643,13 @@ parse_css_file = {PARSE_CSS_FILE}
{
while (($file = readdir($dp)) !== false)
{
- if (!is_dir($phpbb_root_path . 'styles/' . $file))
+ if ($file[0] == '.' || !is_dir($phpbb_root_path . 'styles/' . $file))
{
continue;
}
$subpath = ($mode != 'style') ? "$mode/" : '';
- if ($file[0] != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
+ if (file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
{
if ($cfg = file("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
{
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 917433a970..4f52c7c2ce 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2139,8 +2139,8 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
{
global $_SID, $_EXTRA_URL, $phpbb_hook;
- // Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropiatly.
- // They could mimick most of what is within this function
+ // Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropriately.
+ // They could mimic most of what is within this function
if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__, $url, $params, $is_amp, $session_id))
{
if ($phpbb_hook->hook_return(__FUNCTION__))
@@ -2297,6 +2297,8 @@ function redirect($url, $return = false, $disable_cd_check = false)
{
global $db, $cache, $config, $user, $phpbb_root_path;
+ $failover_flag = false;
+
if (empty($user->lang))
{
$user->add_lang('common');
@@ -2344,65 +2346,69 @@ function redirect($url, $return = false, $disable_cd_check = false)
if (!file_exists($pathinfo['dirname']))
{
// fallback to "last known user page"
+ // at least this way we know the user does not leave the phpBB root
$url = generate_board_url() . '/' . $user->page['page'];
- break;
+ $failover_flag = true;
}
}
- // Is the uri pointing to the current directory?
- if ($pathinfo['dirname'] == '.')
+ if (!$failover_flag)
{
- $url = str_replace('./', '', $url);
-
- // Strip / from the beginning
- if ($url && substr($url, 0, 1) == '/')
+ // Is the uri pointing to the current directory?
+ if ($pathinfo['dirname'] == '.')
{
- $url = substr($url, 1);
- }
+ $url = str_replace('./', '', $url);
- if ($user->page['page_dir'])
- {
- $url = generate_board_url() . '/' . $user->page['page_dir'] . '/' . $url;
+ // Strip / from the beginning
+ if ($url && substr($url, 0, 1) == '/')
+ {
+ $url = substr($url, 1);
+ }
+
+ if ($user->page['page_dir'])
+ {
+ $url = generate_board_url() . '/' . $user->page['page_dir'] . '/' . $url;
+ }
+ else
+ {
+ $url = generate_board_url() . '/' . $url;
+ }
}
else
{
- $url = generate_board_url() . '/' . $url;
- }
- }
- else
- {
- // Used ./ before, but $phpbb_root_path is working better with urls within another root path
- $root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($phpbb_root_path)));
- $page_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($pathinfo['dirname'])));
- $intersection = array_intersect_assoc($root_dirs, $page_dirs);
+ // Used ./ before, but $phpbb_root_path is working better with urls within another root path
+ $root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($phpbb_root_path)));
+ $page_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($pathinfo['dirname'])));
+ $intersection = array_intersect_assoc($root_dirs, $page_dirs);
- $root_dirs = array_diff_assoc($root_dirs, $intersection);
- $page_dirs = array_diff_assoc($page_dirs, $intersection);
+ $root_dirs = array_diff_assoc($root_dirs, $intersection);
+ $page_dirs = array_diff_assoc($page_dirs, $intersection);
- $dir = str_repeat('../', sizeof($root_dirs)) . implode('/', $page_dirs);
+ $dir = str_repeat('../', sizeof($root_dirs)) . implode('/', $page_dirs);
- // Strip / from the end
- if ($dir && substr($dir, -1, 1) == '/')
- {
- $dir = substr($dir, 0, -1);
- }
+ // Strip / from the end
+ if ($dir && substr($dir, -1, 1) == '/')
+ {
+ $dir = substr($dir, 0, -1);
+ }
- // Strip / from the beginning
- if ($dir && substr($dir, 0, 1) == '/')
- {
- $dir = substr($dir, 1);
- }
+ // Strip / from the beginning
+ if ($dir && substr($dir, 0, 1) == '/')
+ {
+ $dir = substr($dir, 1);
+ }
- $url = str_replace($pathinfo['dirname'] . '/', '', $url);
+ $url = str_replace($pathinfo['dirname'] . '/', '', $url);
- // Strip / from the beginning
- if (substr($url, 0, 1) == '/')
- {
- $url = substr($url, 1);
- }
+ // Strip / from the beginning
+ if (substr($url, 0, 1) == '/')
+ {
+ $url = substr($url, 1);
+ }
- $url = (!empty($dir) ? $dir . '/' : '') . $url;
- $url = generate_board_url() . '/' . $url;
+ $url = (!empty($dir) ? $dir . '/' : '') . $url;
+ $url = generate_board_url() . '/' . $url;
+ }
}
}
@@ -4251,7 +4257,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'S_TOPIC_ID' => $topic_id,
'S_LOGIN_ACTION' => ((!defined('ADMIN_START')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("index.$phpEx", false, true, $user->session_id)),
- 'S_LOGIN_REDIRECT' => build_hidden_fields(array('redirect' => str_replace('&amp;', '&', build_url()))),
+ 'S_LOGIN_REDIRECT' => build_hidden_fields(array('redirect' => build_url())),
'S_ENABLE_FEEDS' => ($config['feed_enable']) ? true : false,
'S_ENABLE_FEEDS_OVERALL' => ($config['feed_overall']) ? true : false,
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 1a302d5991..0a01b4e73b 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -608,6 +608,12 @@ class session
}
else
{
+ // Bot user, if they have a SID in the Request URI we need to get rid of it
+ // otherwise they'll index this page with the SID, duplicate content oh my!
+ if (isset($_GET['sid']))
+ {
+ redirect(build_url(array('sid')));
+ }
$this->data['session_last_visit'] = $this->time_now;
}
@@ -977,7 +983,7 @@ class session
}
// only called from CRON; should be a safe workaround until the infrastructure gets going
- if (!class_exists('captcha_factory'))
+ if (!class_exists('phpbb_captcha_factory'))
{
include($phpbb_root_path . "includes/captcha/captcha_factory." . $phpEx);
}
diff --git a/phpBB/styles/prosilver/template/mcp_reports.html b/phpBB/styles/prosilver/template/mcp_reports.html
index 649154deb4..eefb24ee91 100644
--- a/phpBB/styles/prosilver/template/mcp_reports.html
+++ b/phpBB/styles/prosilver/template/mcp_reports.html
@@ -54,7 +54,7 @@
</dt>
<dd class="moderation">
<span>{postrow.REPORTER_FULL} &laquo; {postrow.REPORT_TIME}<br />
- {L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a></span>
+ <!-- IF postrow.U_VIEWFORUM -->{L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span>
</dd>
<!-- ENDIF -->
<dd class="mark"><input type="checkbox" name="report_id_list[]" value="{postrow.REPORT_ID}" /></dd>
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 72b5074351..d18508ccbc 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -592,12 +592,14 @@ if (sizeof($topic_list))
{
$row = &$rowset[$topic_id];
+ $topic_forum_id = ($row['forum_id']) ? (int) $row['forum_id'] : $forum_id;
+
// This will allow the style designer to output a different header
// or even separate the list of announcements from sticky and normal topics
$s_type_switch_test = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0;
// Replies
- $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
+ $replies = ($auth->acl_get('m_approve', $topic_forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
if ($row['topic_status'] == ITEM_MOVED)
{
@@ -614,16 +616,16 @@ if (sizeof($topic_list))
topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type);
// Generate all the URIs ...
- $view_topic_url_params = 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&amp;t=' . $topic_id;
+ $view_topic_url_params = 'f=' . $topic_forum_id . '&amp;t=' . $topic_id;
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params);
- $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', (($row['forum_id']) ? $row['forum_id'] : $forum_id))) ? true : false;
- $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', (($row['forum_id']) ? $row['forum_id'] : $forum_id))) ? true : false;
+ $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $topic_forum_id)) ? true : false;
+ $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $topic_forum_id)) ? true : false;
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$topic_id", true, $user->session_id) : '';
// Send vars to template
$template->assign_block_vars('topicrow', array(
- 'FORUM_ID' => $forum_id,
+ 'FORUM_ID' => $topic_forum_id,
'TOPIC_ID' => $topic_id,
'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
@@ -651,13 +653,13 @@ if (sizeof($topic_list))
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
- 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
+ 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $topic_forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
'S_TOPIC_TYPE' => $row['topic_type'],
'S_USER_POSTED' => (isset($row['topic_posted']) && $row['topic_posted']) ? true : false,
'S_UNREAD_TOPIC' => $unread_topic,
- 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $forum_id)) ? true : false,
+ 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $topic_forum_id)) ? true : false,
'S_TOPIC_UNAPPROVED' => $topic_unapproved,
'S_POSTS_UNAPPROVED' => $posts_unapproved,
'S_HAS_POLL' => ($row['poll_start']) ? true : false,
@@ -672,7 +674,7 @@ if (sizeof($topic_list))
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'U_VIEW_TOPIC' => $view_topic_url,
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=reports&amp;f=' . $forum_id . '&amp;t=' . $topic_id, true, $user->session_id),
+ 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=reports&amp;f=' . $topic_forum_id . '&amp;t=' . $topic_id, true, $user->session_id),
'U_MCP_QUEUE' => $u_mcp_queue,
'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test)