From c3bfe9000eb7588e848ef43886ea47caa5b1625c Mon Sep 17 00:00:00 2001
From: Pablo_Pukha <61611-Pablo_Pukha@users.noreply.drupalcode.org>
Date: Fri, 29 Dec 2023 17:26:35 +0530
Subject: [PATCH] Issue #3373861 by Pablo_Pukha: The wildcard not work correct

---
 page_specific_class.module | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/page_specific_class.module b/page_specific_class.module
index ca0e589..8a8dfe3 100755
--- a/page_specific_class.module
+++ b/page_specific_class.module
@@ -33,13 +33,10 @@ function page_specific_class_preprocess_html(&$variables) {
         $classes_array = explode(' ', $class);
         $front_page = \Drupal::service('path.matcher')->isFrontPage();
         $enteredPath = \Drupal::service('path_alias.manager')->getPathByAlias($url);
-        $alias_path = \Drupal::service('path_alias.manager')->getAliasByPath($current_path);
 
         // Check wildcard.
         if (strpos($url, '*') !== FALSE) {
-          $path = str_replace('/*', '', $url);
-          $path = str_replace('*', '', $path);
-          if (strpos($alias_path, $path) === 0) {
+          if (Drupal::service('path.matcher')->matchPath($current_path, $url)) {
             $passWildCard = TRUE;
           }
         }
-- 
GitLab