diff --git a/src/GitList/Util/Routing.php b/src/GitList/Util/Routing.php index 28724e8..ad6ce81 100644 --- a/src/GitList/Util/Routing.php +++ b/src/GitList/Util/Routing.php @@ -19,13 +19,20 @@ class Routing if ($regex === null) { $app = $this->app; + $self = $this; $quotedPaths = array_map( #function ($repo) use ($app) { # return preg_quote($app['util.routing']->getRelativePath($repo['path']), '#'); #}, # TODO: return keys instead - function ($repo) use ($app) { - return $repo['name']; + + function ($repo) use ($app, $self) { + $repoName = $repo['name'] ; + //Windows + if ($self->OSIsWindows()){ + $repoName = str_replace('\\', '\\\\',$repoName); + } + return $repoName; }, $this->app['git']->getRepositories($this->app['git.repos']) ); @@ -35,6 +42,17 @@ class Routing return $regex; } + + public function OSIsWindows() + { + switch(PHP_OS){ + case 'WIN32': + case 'WINNT': + case 'Windows': return true; + default : return false; + } + + } /** * Strips the base path from a full repository path