aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/posting.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-01-17 18:41:49 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-01-17 18:41:49 +0000
commita841fe70a8234bf158165105339e32aa5ceb75a2 (patch)
treea3e85eb75ec6bb59b331bd830667532d4511a868 /phpBB/posting.php
parent708113b790368fffbf57eb5b96c8132eda00ba9c (diff)
downloadforums-a841fe70a8234bf158165105339e32aa5ceb75a2.tar
forums-a841fe70a8234bf158165105339e32aa5ceb75a2.tar.gz
forums-a841fe70a8234bf158165105339e32aa5ceb75a2.tar.bz2
forums-a841fe70a8234bf158165105339e32aa5ceb75a2.tar.xz
forums-a841fe70a8234bf158165105339e32aa5ceb75a2.zip
ok, handled some bugs... the most important being validate_username (the variable passed to validate_data([...]array('username', [...])) and updating group listings while doing relevant group actions. Oh, and PM icons are working now. :o
git-svn-id: file:///svn/phpbb/trunk@6894 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r--phpBB/posting.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 364cf26339..2bb1329d16 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -549,7 +549,8 @@ if ($submit || $preview || $refresh)
$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['orig_topic_type'] = $post_data['topic_type'];
$post_data['topic_type'] = request_var('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL));
$post_data['topic_time_limit'] = request_var('topic_time_limit', (($mode != 'post') ? (int) $post_data['topic_time_limit'] : 0));
$post_data['icon_id'] = request_var('icon', 0);
@@ -799,7 +800,16 @@ if ($submit || $preview || $refresh)
if (!$auth->acl_get($auth_option, $forum_id))
{
- $error[] = $user->lang['CANNOT_POST_' . str_replace('F_', '', strtoupper($auth_option))];
+ // There is a special case where a user edits his post whereby the topic type got changed by an admin/mod
+ if ($mode == 'edit' && $post_data['poster_id'] == $user->data['user_id'])
+ {
+ // To prevent non-authed users messing around with the topic type we reset it to the original one.
+ $post_data['topic_type'] = $post_data['orig_topic_type'];
+ }
+ else
+ {
+ $error[] = $user->lang['CANNOT_POST_' . str_replace('F_', '', strtoupper($auth_option))];
+ }
}
}