diff --git a/src/Util/Routing.php b/src/Util/Routing.php index 677f2aa..d4bfbd7 100644 --- a/src/Util/Routing.php +++ b/src/Util/Routing.php @@ -106,36 +106,24 @@ class Routing public function getRepositoryRegex() { static $regex = null; - if ($regex === null) { - $isWindows = $this->isWindows(); $quotedPaths = array_map( - function ($repo) use ($isWindows) { - $repoName = preg_quote($repo['name']); - - if ($isWindows) { - $repoName = str_replace('\\', '\\\\', $repoName); - } - - return $repoName; + function ($repo) { + return preg_quote($repo['name'], '#'); }, $this->app['git']->getRepositories($this->app['git.repos']) ); - usort( $quotedPaths, function ($a, $b) { return strlen($b) - strlen($a); } ); - $regex = implode('|', $quotedPaths); } - return $regex; } - public function isWindows() { switch (PHP_OS) {