From 86708c1a9e6e6fc81d6f9f07938c03400d082367 Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 13 Apr 2020 19:24:49 -0400 Subject: [PATCH] Fix regex issue Reqex was not strict enough before so it was matching too many things Anything that began with part of a module name would match --- ModuleJson.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ModuleJson.php b/ModuleJson.php index 0715687..010bc55 100755 --- a/ModuleJson.php +++ b/ModuleJson.php @@ -41,7 +41,7 @@ public function find(array $route) { private function getRouteDir($moduleName) { $files = glob($this->moduleDir . '/*'); - $match = preg_grep('/' . $this->moduleDir . '\/' . $moduleName . '/i', $files); + $match = preg_grep('/^' . $this->moduleDir . '\/' . $moduleName . '$/i', $files); return array_values($match)[0] ?? false; }