Skip to content
Snippets Groups Projects
Commit c3bfe900 authored by pablo_pukha's avatar pablo_pukha Committed by hardik patel
Browse files

Issue #3373861 by Pablo_Pukha: The wildcard not work correct

parent 73730116
No related branches found
No related tags found
No related merge requests found
...@@ -33,13 +33,10 @@ function page_specific_class_preprocess_html(&$variables) { ...@@ -33,13 +33,10 @@ function page_specific_class_preprocess_html(&$variables) {
$classes_array = explode(' ', $class); $classes_array = explode(' ', $class);
$front_page = \Drupal::service('path.matcher')->isFrontPage(); $front_page = \Drupal::service('path.matcher')->isFrontPage();
$enteredPath = \Drupal::service('path_alias.manager')->getPathByAlias($url); $enteredPath = \Drupal::service('path_alias.manager')->getPathByAlias($url);
$alias_path = \Drupal::service('path_alias.manager')->getAliasByPath($current_path);
// Check wildcard. // Check wildcard.
if (strpos($url, '*') !== FALSE) { if (strpos($url, '*') !== FALSE) {
$path = str_replace('/*', '', $url); if (Drupal::service('path.matcher')->matchPath($current_path, $url)) {
$path = str_replace('*', '', $path);
if (strpos($alias_path, $path) === 0) {
$passWildCard = TRUE; $passWildCard = TRUE;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment