Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions google_tag.module
Original file line number Diff line number Diff line change
Expand Up @@ -231,20 +231,20 @@ function _google_tag_path_check() {
if (!isset($satisfied)) {
$config = \Drupal::config('google_tag.settings');
$toggle = $config->get('path_toggle');
$paths = Unicode::strtolower($config->get('path_list'));
$paths = mb_strtolower($config->get('path_list'));

if (empty($paths)) {
$satisfied = ($toggle == GOOGLE_TAG_EXCLUDE_LISTED);
}
else {
$request = \Drupal::request();
$current_path = \Drupal::service('path.current');
$alias_manager = \Drupal::service('path.alias_manager');
$alias_manager = \Drupal::service('path_alias.manager');
$path_matcher = \Drupal::service('path.matcher');
// @todo Are not some paths case sensitive???
// Compare the lowercase path alias (if any) and internal path.
$path = rtrim($current_path->getPath($request), '/');
$path_alias = Unicode::strtolower($alias_manager->getAliasByPath($path));
$path_alias = mb_strtolower($alias_manager->getAliasByPath($path));
$satisfied = $path_matcher->matchPath($path_alias, $paths) || (($path != $path_alias) && $path_matcher->matchPath($path, $paths));
$satisfied = ($toggle == GOOGLE_TAG_EXCLUDE_LISTED) ? !$satisfied : $satisfied;
}
Expand Down