Skip to content

Commit

Permalink
strip script tags from XSLT block stylesheets
Browse files Browse the repository at this point in the history
  • Loading branch information
Guite committed Sep 20, 2021
1 parent a43c7bd commit bc5a435
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-3.0.md
Expand Up @@ -8,6 +8,7 @@
- Fixes:
- [CoreBundle] More robust autoloader detection.
- [CoreBundle] Add `flex-wrap` class to pagination for responsive behaviour ([bs#23504](https://github.com/twbs/bootstrap/issues/23504)).
- [Blocks] Strip script tags from XSLT block stylesheets.
- [Categories] Sanitize context menu in admin category list.
- [Theme] Fix resolving assets location on Windows if Zikula is installed in a sub directory (#4480).
- [Permissions] Correctly handle non-existing username during permission testing.
Expand Down
7 changes: 7 additions & 0 deletions src/system/BlocksModule/Block/XsltBlock.php
Expand Up @@ -38,6 +38,13 @@ public function display(array $properties): string
} else {
$doc->loadXML($properties['stylecontents']);
}

// remove scripts
$scriptTags = $doc->getElementsByTagName('script');
foreach ($scriptTags as $scriptTag) {
$scriptTag->parentNode->removeChild($scriptTag);
}

$xsl->importStyleSheet($doc);

// load xml source
Expand Down

0 comments on commit bc5a435

Please sign in to comment.