diff --git a/main/forum/viewforum.php b/main/forum/viewforum.php index a584a33e7d..0486f53765 100755 --- a/main/forum/viewforum.php +++ b/main/forum/viewforum.php @@ -140,7 +140,7 @@ if (!empty($groupId)) { $interbreadcrumb[] = [ 'url' => $forumUrl.'viewforumcategory.php?forumcategory='.$current_forum_category['cat_id'] .'&search='.Security::remove_XSS(urlencode($my_search)), - 'name' => prepare4display($current_forum_category['cat_title']), + 'name' => Security::remove_XSS(prepare4display($current_forum_category['cat_title'])), ]; $interbreadcrumb[] = [ 'url' => '#', @@ -375,7 +375,7 @@ if (api_is_allowed_to_edit(false, true) || echo ''; /* Display */ -$titleForum = $current_forum['forum_title']; +$titleForum = Security::remove_XSS($current_forum['forum_title']); $descriptionForum = $current_forum['forum_comment']; $iconForum = Display::return_icon( 'forum_yellow.png', @@ -440,7 +440,7 @@ if (is_array($threads)) { $linkPostForum = '' - .$row['thread_title'].''; + .Security::remove_XSS($row['thread_title']).''; $html = ''; $html .= '
'; $html .= '
'; diff --git a/main/forum/viewforumcategory.php b/main/forum/viewforumcategory.php index 64708411a1..e7273d720a 100755 --- a/main/forum/viewforumcategory.php +++ b/main/forum/viewforumcategory.php @@ -126,8 +126,6 @@ echo $html; $logInfo = [ 'tool' => TOOL_FORUM, - 'tool_id' => 0, - 'tool_id_detail' => 0, 'action' => $action, 'info' => isset($_GET['content']) ? $_GET['content'] : '', ]; @@ -181,7 +179,7 @@ if ($action != 'add') { $forum_categories_list = []; $forumId = $forum_category['cat_id']; - $forumTitle = $forum_category['cat_title']; + $forumTitle = Security::remove_XSS($forum_category['cat_title']); $linkForumCategory = 'viewforumcategory.php?'.api_get_cidreq().'&forumcategory='.strval(intval($forumId)); $descriptionCategory = $forum_category['cat_comment']; $icoCategory = Display::return_icon( @@ -271,15 +269,12 @@ if ($action != 'add') { // you are teacher => show forum if (api_is_allowed_to_edit(false, true)) { - //echo 'teacher'; $show_forum = true; } else { // you are not a teacher - //echo 'student'; // it is not a group forum => show forum // (invisible forums are already left out see get_forums function) if ($forum['forum_of_group'] == '0') { - //echo '-gewoon forum'; $show_forum = true; } else { // it is a group forum @@ -287,16 +282,13 @@ if ($action != 'add') { // it is a group forum but it is public => show if ($forum['forum_group_public_private'] == 'public') { $show_forum = true; - //echo '-publiek'; } else { // it is a group forum and it is private //echo '-prive'; // it is a group forum and it is private but the user is member of the group if (in_array($forum['forum_of_group'], $groups_of_user)) { - //echo '-is lid'; $show_forum = true; } else { - //echo '-is GEEN lid'; $show_forum = false; } } @@ -360,14 +352,14 @@ if ($action != 'add') { $html .= '
'; $iconForum = Display::return_icon( 'forum_yellow.png', - get_lang($forum_category['cat_title']), + Security::remove_XSS(get_lang($forum_category['cat_title'])), null, ICON_SIZE_MEDIUM ); $linkForum = Display::tag( 'a', - $forum['forum_title'].$session_displayed, + Security::remove_XSS($forum['forum_title']).$session_displayed, [ 'href' => 'viewforum.php?'.api_get_cidreq(true, false)."&gidReq={$forum['forum_of_group']}&forum={$forum['forum_id']}&search=".Security::remove_XSS(urlencode(isset($_GET['search']) ? $_GET['search'] : '')), 'class' => empty($forum['visibility']) ? 'text-muted' : null, @@ -382,7 +374,7 @@ if ($action != 'add') { ); $html .= Display::tag( 'p', - strip_tags($forum['forum_comment']), + Security::remove_XSS(strip_tags($forum['forum_comment'])), [ 'class' => 'description', ] diff --git a/main/template/default/forum/list.tpl b/main/template/default/forum/list.tpl index 46ff57ea13..1916651042 100644 --- a/main/template/default/forum/list.tpl +++ b/main/template/default/forum/list.tpl @@ -47,7 +47,7 @@ {% if fold_forum_categories %} {% set panel_icon %} - + {{ 'forum_blue.png'|img(32) }} {% endset %} @@ -62,7 +62,8 @@ {% set panel_title %} {{ 'forum_blue.png'|img(32) }} - {{ item.title }}{{ item.icon_session }} + {{ item.title | remove_xss }} + {{ item.icon_session }} {% for category_language_item in category_language_array %} @@ -106,7 +107,13 @@

{{ 'forum_yellow.png'|img(32) }} - {{ subitem.title }} + + {{ subitem.title | remove_xss }} + {% if subitem.forum_of_group != 0 %} {{ "forum.png"|img(22) }} {{ "GoTo"|get_lang }} {{ subitem.forum_group_title }} @@ -124,16 +131,16 @@

{% endif %}
- {{ subitem.description }} + {{ subitem.description | remove_xss }}
{{ subitem.last_post_text }} - {{ subitem.alert }} + {% if subitem.moderation is not empty %} - {{ "PostsPendingModeration"|get_lang }}: {{ subitem.moderation }} - + {{ "PostsPendingModeration"|get_lang }}: {{ subitem.moderation }} + {% endif %}