Skip to content
Snippets Groups Projects
Commit d1e1e7a3 authored by Kevin Paxman's avatar Kevin Paxman Committed by Kevin Paxman
Browse files

ISTWCMS-4653: refine RegEx so it won't include edge cases

parent abf9620b
No related branches found
No related tags found
1 merge request!61ISTWCMS-4653: checking for unpublished nodes when getting the menu
......@@ -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]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment