Skip to content
This repository has been archived by the owner on Aug 18, 2022. It is now read-only.

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 05bcec7 commit 3e1b581
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Block/XsltBlock.php
Original file line number Diff line number Diff line change
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 3e1b581

Please sign in to comment.