Skip to content

Commit

Permalink
Security: Portfolio: Apply remove XSS on items and comments content -…
Browse files Browse the repository at this point in the history
… refs BT#22113
  • Loading branch information
AngelFQC committed Oct 17, 2024
1 parent b544020 commit 7a72f09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions main/inc/lib/PortfolioController.php
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ public function addItem()
});
$(\'#add_portfolio_template\').on(\'change\', function () {
$(\'#portfolio-spinner\').show();
$.getJSON(_p.web_ajax + \'portfolio.ajax.php?a=find_template&item=\' + this.value)
.done(function(response) {
if (CKEDITOR.instances.title) {
Expand Down Expand Up @@ -3994,7 +3994,7 @@ private function createCommentForm(Portfolio $item): string
$(function() {
$(\'#frm_comment_template\').on(\'change\', function () {
$(\'#portfolio-spinner\').show();
$.getJSON(_p.web_ajax + \'portfolio.ajax.php?a=find_template_comment&comment=\' + this.value)
.done(function(response) {
CKEDITOR.instances.content.setData(response.content);
Expand Down Expand Up @@ -4094,7 +4094,7 @@ private function generateItemContent(Portfolio $item): string
$origin = $em->find(Portfolio::class, $item->getOrigin());

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

if ($origin) {
$originContent = $origin->getContent();
$originContent = Security::remove_XSS($origin->getContent());
$originContentFooter = vsprintf(
get_lang('OriginallyCommentedByXUserInYItem'),
[
Expand Down
2 changes: 1 addition & 1 deletion main/template/default/portfolio/view.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</ul>
</header>

{{ item_content }}
{{ item_content|remove_xss }}

{% if attachment_list %}
<section>
Expand Down

0 comments on commit 7a72f09

Please sign in to comment.