]> BookStack Code Mirror - bookstack/commit
Fixed issue with HTML tags in custom head scripts
authorDan Brown <redacted>
Sun, 5 Sep 2021 22:52:39 +0000 (23:52 +0100)
committerDan Brown <redacted>
Sun, 5 Sep 2021 22:52:39 +0000 (23:52 +0100)
commit88c698796b2097301d494a9109631aa2bc96ec48
tree703de4cd98fbf471450c3f678ad0397123459e0a
parentd815e1b9f2657fd1a4aa4ca9841050363b1eed9f
Fixed issue with HTML tags in custom head scripts

Fixes a strange issue of HTML tags within script tags being malformed
when part of the HTML custom head content due to the PHP parsing we do.
DOMDocument seemed to cause this upon load.
Adding LIBXML_SCHEMA_CREATE to the ->loadHTML call seems to fix this but
not really sure why. Doesn't seem to cause further issues though.
Tested with multiple scripts and styles and comments and meta tags.

- Also added new testing class to cover.
- As part of testing, added new folder within tests to house setting
  specific tests.

For #2914
app/Util/HtmlNonceApplicator.php
tests/Settings/CustomHeadContentTest.php [new file with mode: 0644]
tests/Settings/FooterLinksTest.php [moved from tests/FooterLinksTest.php with 98% similarity]
Morty Proxy This is a proxified and sanitized view of the page, visit original site.