From 691f784f92d5c5d6e5f742f56ea154a711f76d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20La=C3=AF=20Trinh?= Date: Thu, 28 Nov 2013 17:53:05 +0100 Subject: [PATCH] fix bug introduced in https://github.com/composer/composer/pull/2375 --- src/Composer/Repository/Vcs/GitHubDriver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Repository/Vcs/GitHubDriver.php b/src/Composer/Repository/Vcs/GitHubDriver.php index 428c2fdf4..3cf2befb5 100644 --- a/src/Composer/Repository/Vcs/GitHubDriver.php +++ b/src/Composer/Repository/Vcs/GitHubDriver.php @@ -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; }