Loading micro_site.module +6 −6 Original line number Diff line number Diff line Loading @@ -295,18 +295,18 @@ function micro_site_page_attachments_alter(array &$attachments) { $favicon_changed = FALSE; $type = $file->getMimeType(); $favicon_uri = $file->getFileUri(); $favicon_url = file_url_transform_relative(file_create_url($favicon_uri)); $favicon_url = \Drupal::service('file_url_generator')->generateString($favicon_uri); $html_head_link = $attachments['#attached']['html_head_link']; foreach ($html_head_link as $key => $value) { if (isset($value[0]['rel'])) { switch ($value[0]['rel']) { case 'shortcut icon': case 'icon': $attachments['#attached']['html_head_link'][$key] = [ [ 'rel' => 'shortcut icon', 'rel' => 'icon', 'href' => UrlHelper::stripDangerousProtocols($favicon_url), 'type' => $type, ] ], ]; $favicon_changed = TRUE; break; Loading @@ -316,7 +316,7 @@ function micro_site_page_attachments_alter(array &$attachments) { if (!$favicon_changed) { $attachments['#attached']['html_head_link'][][] = [ 'rel' => 'shortcut icon', 'rel' => 'icon', 'href' => UrlHelper::stripDangerousProtocols($favicon_url), 'type' => $type, ]; Loading Loading
micro_site.module +6 −6 Original line number Diff line number Diff line Loading @@ -295,18 +295,18 @@ function micro_site_page_attachments_alter(array &$attachments) { $favicon_changed = FALSE; $type = $file->getMimeType(); $favicon_uri = $file->getFileUri(); $favicon_url = file_url_transform_relative(file_create_url($favicon_uri)); $favicon_url = \Drupal::service('file_url_generator')->generateString($favicon_uri); $html_head_link = $attachments['#attached']['html_head_link']; foreach ($html_head_link as $key => $value) { if (isset($value[0]['rel'])) { switch ($value[0]['rel']) { case 'shortcut icon': case 'icon': $attachments['#attached']['html_head_link'][$key] = [ [ 'rel' => 'shortcut icon', 'rel' => 'icon', 'href' => UrlHelper::stripDangerousProtocols($favicon_url), 'type' => $type, ] ], ]; $favicon_changed = TRUE; break; Loading @@ -316,7 +316,7 @@ function micro_site_page_attachments_alter(array &$attachments) { if (!$favicon_changed) { $attachments['#attached']['html_head_link'][][] = [ 'rel' => 'shortcut icon', 'rel' => 'icon', 'href' => UrlHelper::stripDangerousProtocols($favicon_url), 'type' => $type, ]; Loading