From 83b28ce6fb4d7cd0db942d54a88fd873da89234c Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Tue, 22 Jul 2003 14:01:41 +0000 Subject: [PATCH] Less aggressive stripslash for messages git-svn-id: file:///svn/phpbb/trunk@4311 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/posting.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/phpBB/posting.php b/phpBB/posting.php index f8d478994e..3fd1f0f6d9 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -30,7 +30,6 @@ include($phpbb_root_path . 'includes/message_parser.'.$phpEx); // Start session management $user->start(); $auth->acl($user->data); -$user->setup(); // Grab only parameters needed here @@ -504,7 +503,7 @@ if ($submit || $preview || $refresh) $subject = phpbb_strtolower($subject); } - $message_parser->message = (!empty($_POST['message'])) ? trim(stripslashes($_POST['message'])) : ''; + $message_parser->message = (!empty($_POST['message'])) ? trim(str_replace(array('\\\'', '\\"', '\\0', '\\\\'), array('\'', '"', '\0', '\\'), $_POST['message'])) : ''; $username = (!empty($_POST['username'])) ? trim($_POST['username']) : ((!empty($username)) ? $username : ''); $topic_type = (!empty($_POST['topic_type'])) ? (int) $_POST['topic_type'] : (($mode != 'post') ? $topic_type : POST_NORMAL); @@ -1755,7 +1754,7 @@ function topic_review($topic_id, $forum_id, $is_inline_review = false) } // Get topic info ... - $sql = 'SELECT t.topic_title, f.forum_id + $sql = 'SELECT t.topic_title, f.forum_id, f.forum_style FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f WHERE t.topic_id = $topic_id AND f.forum_id IN (t.forum_id, $forum_id)"; @@ -1769,6 +1768,8 @@ function topic_review($topic_id, $forum_id, $is_inline_review = false) $forum_id = $row['forum_id']; $topic_title = $row['topic_title']; + $user->setup(false, $row['forum_style']); + if (!$auth->acl_get('f_read', $forum_id)) { trigger_error($user->lang['SORRY_AUTH_READ']);