core/lib/Drupal/Core/EventSubscriber/ActiveLinkResponseFilter.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/lib/Drupal/Core/EventSubscriber/ActiveLinkResponseFilter.php b/core/lib/Drupal/Core/EventSubscriber/ActiveLinkResponseFilter.php index a8e6ba1..3c9fa5e 100644 --- a/core/lib/Drupal/Core/EventSubscriber/ActiveLinkResponseFilter.php +++ b/core/lib/Drupal/Core/EventSubscriber/ActiveLinkResponseFilter.php @@ -21,6 +21,11 @@ /** * Subscribes to filter HTML responses, to set the 'is-active' class on links. + * + * Only for anonymous users; for authenticated users, the active-link asset + * library is loaded. + * + * @see system_page_attachments() */ class ActiveLinkResponseFilter implements EventSubscriberInterface { @@ -79,7 +84,7 @@ public function __construct(AccountInterface $current_user, CurrentPathStack $cu */ public function onResponse(FilterResponseEvent $event) { // Only care about HTML responses. - if (FALSE === stripos($event->getResponse()->headers->get('Content-Type'), 'text/html')) { + if (stripos($event->getResponse()->headers->get('Content-Type'), 'text/html') === FALSE) { return; }