From 3c9205a079f036e00191853f59ea3d18343ab281 Mon Sep 17 00:00:00 2001 From: Christian Schorn Date: Wed, 31 Oct 2012 14:44:45 +0100 Subject: [PATCH] Sort repository regex paths by longest first --- src/GitList/Util/Routing.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GitList/Util/Routing.php b/src/GitList/Util/Routing.php index c283fec..0f22dae 100644 --- a/src/GitList/Util/Routing.php +++ b/src/GitList/Util/Routing.php @@ -25,6 +25,7 @@ class Routing }, $this->app['git']->getRepositories($this->app['git.repos']) ); + usort($quoted_paths, function ($a, $b) { return strlen($b) - strlen($a); }); $regex = implode('|', $quoted_paths); }