Explorar o código

fix bug introduced in https://github.com/composer/composer/pull/2375

Kim Laï Trinh %!s(int64=11) %!d(string=hai) anos
pai
achega
691f784f92
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/Composer/Repository/Vcs/GitHubDriver.php

+ 2 - 2
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;
         }