Skip to content

Commit

Permalink
fix: XSS in forum (opentibiabr#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
majestyotbr authored Sep 13, 2024
1 parent 3e23cb0 commit da8017e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions system/pages/forum/new_post.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

$thread = $db->query("SELECT `" . FORUM_TABLE_PREFIX . "forum`.`post_topic`, `" . FORUM_TABLE_PREFIX . "forum`.`id`, `" . FORUM_TABLE_PREFIX . "forum`.`section` FROM `" . FORUM_TABLE_PREFIX . "forum` WHERE `" . FORUM_TABLE_PREFIX . "forum`.`id` = " . $thread_id . " AND `" . FORUM_TABLE_PREFIX . "forum`.`first_post` = " . $thread_id . " LIMIT 1")->fetch();
if (isset($thread['id']) && Forum::hasAccess($thread['section'])) {
echo '<div class="ForumBreadCrumbs"><a href="' . getLink('forum') . '">Community Boards</a> | <a href="' . getForumBoardLink($thread['section']) . '">' . $sections[$thread['section']]['name'] . '</a> | <a href="' . getForumThreadLink($thread_id) . '">' . $thread['post_topic'] . '</a> | <b>Post New Reply</b></div><br />';
echo '<div class="ForumBreadCrumbs"><a href="' . getLink('forum') . '">Community Boards</a> | <a href="' . getForumBoardLink($thread['section']) . '">' . $sections[$thread['section']]['name'] . '</a> | <a href="' . getForumThreadLink($thread_id) . '">' . htmlspecialchars($thread['post_topic']) . '</a> | <b>Post New Reply</b></div><br />';
$quote = (int)$_REQUEST['quote'] ?? NULL;
$text = isset($_REQUEST['text']) ? stripslashes(trim($_REQUEST['text'])) : NULL;
$char_id = (int)$_REQUEST['char_id'] ?? 0;
Expand Down Expand Up @@ -95,7 +95,7 @@
'post_text' => $text,
'post_smile' => $smile > 0,
'post_html' => $html > 0,
'topic' => $thread['post_topic'],
'topic' => htmlspecialchars($thread['post_topic']),
'threads' => $threads,
'canEdit' => $canEdit
));
Expand Down

0 comments on commit da8017e

Please sign in to comment.