diff --git a/Upgrading-Omeka-core.md b/Upgrading-Omeka-core.md index ecc6991..dcdcc25 100644 --- a/Upgrading-Omeka-core.md +++ b/Upgrading-Omeka-core.md @@ -7,7 +7,6 @@ https://git.hangar.org/arcHIVE-tech/Docs/wiki/Disabling-modules ## Remove unwanted blocks from page edit page Blocks are: -* **HTML**: Users can paste text into the Omeka HTML block. This is undesirable because html style and classes are included in the html. We de not want unexpected formats. For this reason we have developed the Markdown text module. Markdown allows basic HTML formatting without extra unwanted text formatting. But we also want to remove the HTML block so users cannot include it in their pages. * **tableOfContents** * **searchingForm** @@ -29,4 +28,37 @@ Then edit the new file, adding these lines `-->>` blockLayout()->getLayoutLabel($layout))); ?> +``` + +**HTML**: Users can paste text into the Omeka HTML block. This is undesirable because html style and classes are included in the html. We de not want unexpected formats. Edit the core to filter html tags and attributes. + +`./application/src/Site/BlockLayout/Html.php` + +Import domdocument + +`use DOMDocument;` + +Add this class to the `class Html extends AbstractBlockLayout` + +``` + public function onHydrate(SitePageBlock $block, ErrorStore $errorStore) + { + $data = $block->getData(); + $html = isset($data['html']) ? $this->htmlPurifier->purify($data['html']) : ''; + // archive strip tags + $html = strip_tags($html, '