Skip to content

Commit 7a72f09

Browse files
committed
Security: Portfolio: Apply remove XSS on items and comments content - refs BT#22113
1 parent b544020 commit 7a72f09

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

main/inc/lib/PortfolioController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ public function addItem()
661661
});
662662
$(\'#add_portfolio_template\').on(\'change\', function () {
663663
$(\'#portfolio-spinner\').show();
664-
664+
665665
$.getJSON(_p.web_ajax + \'portfolio.ajax.php?a=find_template&item=\' + this.value)
666666
.done(function(response) {
667667
if (CKEDITOR.instances.title) {
@@ -3994,7 +3994,7 @@ private function createCommentForm(Portfolio $item): string
39943994
$(function() {
39953995
$(\'#frm_comment_template\').on(\'change\', function () {
39963996
$(\'#portfolio-spinner\').show();
3997-
3997+
39983998
$.getJSON(_p.web_ajax + \'portfolio.ajax.php?a=find_template_comment&comment=\' + this.value)
39993999
.done(function(response) {
40004000
CKEDITOR.instances.content.setData(response.content);
@@ -4094,7 +4094,7 @@ private function generateItemContent(Portfolio $item): string
40944094
$origin = $em->find(Portfolio::class, $item->getOrigin());
40954095

40964096
if ($origin) {
4097-
$originContent = $origin->getContent();
4097+
$originContent = Security::remove_XSS($origin->getContent());
40984098
$originContentFooter = vsprintf(
40994099
get_lang('OriginallyPublishedAsXTitleByYUser'),
41004100
[
@@ -4107,7 +4107,7 @@ private function generateItemContent(Portfolio $item): string
41074107
$origin = $em->find(PortfolioComment::class, $item->getOrigin());
41084108

41094109
if ($origin) {
4110-
$originContent = $origin->getContent();
4110+
$originContent = Security::remove_XSS($origin->getContent());
41114111
$originContentFooter = vsprintf(
41124112
get_lang('OriginallyCommentedByXUserInYItem'),
41134113
[

main/template/default/portfolio/view.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</ul>
4848
</header>
4949

50-
{{ item_content }}
50+
{{ item_content|remove_xss }}
5151

5252
{% if attachment_list %}
5353
<section>

0 commit comments

Comments
 (0)