diff --git a/module/git/model.php b/module/git/model.php index 54512a8611..4e41b40c0d 100644 --- a/module/git/model.php +++ b/module/git/model.php @@ -421,7 +421,11 @@ class gitModel extends model */ public function getRepoByURL($url) { - foreach($this->config->git->repos as $repo) if(strpos($url, $repo['path']) !== false) return (object)$repo; + foreach($this->config->git->repos as $repo) + { + if(empty($repo['path'])) continue; + if(strpos($url, $repo['path']) !== false) return (object)$repo; + } return false; } diff --git a/module/svn/model.php b/module/svn/model.php index b5da380950..d0da2f8813 100644 --- a/module/svn/model.php +++ b/module/svn/model.php @@ -413,7 +413,11 @@ class svnModel extends model */ public function getRepoByURL($url) { - foreach($this->config->svn->repos as $repo) if(strpos($url, $repo['path']) !== false) return (object)$repo; + foreach($this->config->svn->repos as $repo) + { + if(empty($repo['path'])) continue; + if(strpos($url, $repo['path']) !== false) return (object)$repo; + } return false; }