From af8e608b3dc797d360b9ed466bcb22313c4d3552 Mon Sep 17 00:00:00 2001 From: mmyllynen <4696381+dire@users.noreply.github.com> Date: Tue, 28 Mar 2023 08:35:41 +0300 Subject: [PATCH] UHF-8217: Removed the generator tag from DOM. --- helfi_platform_config.module | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/helfi_platform_config.module b/helfi_platform_config.module index 286c8a138..51ffef9d5 100644 --- a/helfi_platform_config.module +++ b/helfi_platform_config.module @@ -113,6 +113,17 @@ function helfi_platform_config_page_attachments(array &$attachments) : void { $attachments['#attached']['library'][] = 'helfi_platform_config/clear_localstorage'; } +/** + * Implements hook_page_attachments_alter(). + */ +function helfi_platform_config_page_attachments_alter(array &$attachments): void { + foreach ($attachments['#attached']['html_head'] as $key => $attachment) { + if ($attachment[1] == 'system_meta_generator') { + unset($attachments['#attached']['html_head'][$key]); + } + } +} + /** * Implements hook_theme(). */