1
0
Fork 0

Merge pull request #2467 from kimlai/bugfix_githubdriver

fix bug in GitHubDriver
pull/2471/head
Jordi Boggiano 2013-11-29 01:28:48 -08:00
commit ae3b7ad5c0
1 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ class GitHubDriver extends VcsDriver
preg_match('#^(?:(?:https?|git)://([^/]+)/|git@([^:]+):)([^/]+)/(.+?)(?:\.git)?$#', $this->url, $match);
$this->owner = $match[3];
$this->repository = $match[4];
$this->originUrl = isset($match[1]) ? $match[1] : $match[2];
$this->originUrl = !empty($match[1]) ? $match[1] : $match[2];
$this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.$this->originUrl.'/'.$this->owner.'/'.$this->repository);
$this->fetchRootIdentifier();
@ -238,7 +238,7 @@ class GitHubDriver extends VcsDriver
return false;
}
$originUrl = isset($matches[2]) ? $matches[2] : $matches[3];
$originUrl = !empty($matches[2]) ? $matches[2] : $matches[3];
if (!in_array($originUrl, $config->get('github-domains'))) {
return false;
}