From 77cf7e8040269ba0c86ed429df967b92ec787194 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 27 Nov 2014 01:02:42 +0000 Subject: [PATCH] * fix a bug. --- module/git/model.php | 6 +++++- module/svn/model.php | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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; }