Skip to content

Commit

Permalink
Revert "Issue #11: Used default theme favicon instead of administrati…
Browse files Browse the repository at this point in the history
…ve theme favicon."

This reverts commit 4a9d9ac.
  • Loading branch information
lexhouk committed Jun 24, 2018
1 parent 4a9d9ac commit dc2fae4
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions d8.profile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* Basis for the site on Drupal 8.
*/

use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Database\Database;
use Drupal\Core\Url;
Expand Down Expand Up @@ -40,24 +39,3 @@ function _d8_user_login_form_submit(array &$form, FormStateInterface $form_state
$form_state->setRedirectUrl(Url::fromUserInput($path));
}
}

/**
* Implements hook_page_attachments_alter().
*/
function d8_page_attachments_alter(array &$attachments) {
$theme = \Drupal::config('system.theme')->get('default');

if ($theme != \Drupal::theme()->getActiveTheme()->getName() && theme_get_setting('features.favicon') && !empty($attachments['#attached']['html_head_link']) && is_array($attachments['#attached']['html_head_link'])) {
foreach ($attachments['#attached']['html_head_link'] as &$links) {
if (!empty($links) && is_array($links)) {
foreach ($links as &$link) {
if (!empty($link) && is_array($link) && !empty($link['rel']) && $link['rel'] == 'shortcut icon' && !empty($link['type']) && $link['type'] == theme_get_setting('favicon.mimetype') && !empty($link['href'])) {
$favicon = theme_get_setting('favicon.url', $theme);
$link['href'] = UrlHelper::stripDangerousProtocols($favicon);
return;
}
}
}
}
}
}

0 comments on commit dc2fae4

Please sign in to comment.