Skip to content

Commit

Permalink
OXDEV-7182 Remove unintentional html wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
tkcreateit committed Sep 4, 2024
1 parent 50cf4f0 commit 23c568d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/HtmlFilter/HtmlFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ private function createDoc(string $html): DOMDocument
private function getInnerHtml(DOMDocument $doc): string
{
$html = '';
foreach ($doc->documentElement->childNodes as $node) {
$div = $doc->documentElement->childNodes->item(0);
foreach ($div->childNodes as $node) {
$html .= $doc->saveHTML($node);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/HtmlFilter/HtmlFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function filterDoesNotRemoveWhenNoScriptTagsFound(string $html): void
->method('remove');
$filter = new HtmlFilter($removerSpy);

$filter->filter($html);
$this->assertEquals($html, $filter->filter($html));
}

public static function noScriptTagsProvider(): array
Expand Down

0 comments on commit 23c568d

Please sign in to comment.