From d1e1e7a339ad6cb33c4196314019cfa347ee2403 Mon Sep 17 00:00:00 2001
From: kpaxman <kpaxman@uwaterloo.ca>
Date: Tue, 9 Mar 2021 13:27:32 -0500
Subject: [PATCH] ISTWCMS-4653: refine RegEx so it won't include edge cases

---
 src/Service/UWService.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Service/UWService.php b/src/Service/UWService.php
index c6be1b05..c3d7b339 100644
--- a/src/Service/UWService.php
+++ b/src/Service/UWService.php
@@ -338,7 +338,7 @@ class UWService implements UWServiceInterface {
       $path = $this->pathAliasManager->getPathByAlias('/' . $alias);
 
       // Check if it is a node path and if so check if published.
-      if (preg_match('/node\/(\d+)/', $path, $matches)) {
+      if (preg_match('/^node\/(\d+)$/', $path, $matches)) {
 
         // Load in the node based on the path.
         $node = $this->entityTypeManager->getStorage('node')->load($matches[1]);
-- 
GitLab