aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/posting.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r--phpBB/posting.php70
1 files changed, 6 insertions, 64 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 1bc498efe7..74a8ebecb5 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -87,9 +87,8 @@ switch ($mode)
$sql = 'SELECT f.*, t.*
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f
WHERE t.topic_id = $topic_id
- AND (f.forum_id = t.forum_id
- OR f.forum_id = $forum_id)" .
- (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1');
+ AND f.forum_id = t.forum_id" .
+ (($auth->acl_get('m_approve', $forum_id)) ? '' : ' AND t.topic_approved = 1');
break;
case 'quote':
@@ -116,9 +115,8 @@ switch ($mode)
WHERE p.post_id = $post_id
AND t.topic_id = p.topic_id
AND u.user_id = p.poster_id
- AND (f.forum_id = t.forum_id
- OR f.forum_id = $forum_id)" .
- (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1');
+ AND f.forum_id = t.forum_id" .
+ (($auth->acl_get('m_approve', $forum_id)) ? '' : ' AND p.post_approved = 1');
break;
case 'smilies':
@@ -182,7 +180,7 @@ $user->setup(array('posting', 'mcp', 'viewtopic'), $post_data['forum_style']);
if ($config['enable_post_confirm'] && !$user->data['is_registered'])
{
include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
- $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+ $captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
$captcha->init(CONFIRM_POST);
}
@@ -635,7 +633,7 @@ if ($submit || $preview || $refresh)
$message_parser->message = utf8_normalize_nfc(request_var('message', '', true));
$post_data['username'] = utf8_normalize_nfc(request_var('username', $post_data['username'], true));
- $post_data['post_edit_reason'] = (!empty($_POST['edit_reason']) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? utf8_normalize_nfc(request_var('edit_reason', '', true)) : '';
+ $post_data['post_edit_reason'] = ($request->variable('edit_reason', false, false, phpbb_request_interface::POST) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? utf8_normalize_nfc(request_var('edit_reason', '', true)) : '';
$post_data['orig_topic_type'] = $post_data['topic_type'];
$post_data['topic_type'] = request_var('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL));
@@ -977,60 +975,6 @@ if ($submit || $preview || $refresh)
// Store message, sync counters
if (!sizeof($error) && $submit)
{
- // Check if we want to de-globalize the topic... and ask for new forum
- if ($post_data['topic_type'] != POST_GLOBAL)
- {
- $sql = 'SELECT topic_type, forum_id
- FROM ' . TOPICS_TABLE . "
- WHERE topic_id = $topic_id";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row && !$row['forum_id'] && $row['topic_type'] == POST_GLOBAL)
- {
- $to_forum_id = request_var('to_forum_id', 0);
-
- if ($to_forum_id)
- {
- $sql = 'SELECT forum_type
- FROM ' . FORUMS_TABLE . '
- WHERE forum_id = ' . $to_forum_id;
- $result = $db->sql_query($sql);
- $forum_type = (int) $db->sql_fetchfield('forum_type');
- $db->sql_freeresult($result);
-
- if ($forum_type != FORUM_POST || !$auth->acl_get('f_post', $to_forum_id) || (!$auth->acl_get('m_approve', $to_forum_id) && !$auth->acl_get('f_noapprove', $to_forum_id)))
- {
- $to_forum_id = 0;
- }
- }
-
- if (!$to_forum_id)
- {
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
-
- $template->assign_vars(array(
- 'S_FORUM_SELECT' => make_forum_select(false, false, false, true, true, true),
- 'S_UNGLOBALISE' => true)
- );
-
- $submit = false;
- $refresh = true;
- }
- else
- {
- if (!$auth->acl_get('f_post', $to_forum_id))
- {
- // This will only be triggered if the user tried to trick the forum.
- trigger_error('NOT_AUTHORISED');
- }
-
- $forum_id = $to_forum_id;
- }
- }
- }
-
if ($submit)
{
// Lock/Unlock Topic
@@ -1603,5 +1547,3 @@ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data)
trigger_error('USER_CANNOT_DELETE');
}
-
-?> \ No newline at end of file