瀏覽代碼

Fix regex cleaning up repo URLs, fixes #5686

Jordi Boggiano 8 年之前
父節點
當前提交
64d29dc6dc
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Composer/Repository/ComposerRepository.php

+ 1 - 1
src/Composer/Repository/ComposerRepository.php

@@ -88,7 +88,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
         $this->config = $config;
         $this->options = $repoConfig['options'];
         $this->url = $repoConfig['url'];
-        $this->baseUrl = rtrim(preg_replace('{^(.*)(?:/[^/\\]+.json)?(?:[?#].*)?$}', '$1', $this->url), '/');
+        $this->baseUrl = rtrim(preg_replace('{(?:/[^/\\\\]+\.json)?(?:[?#].*)?$}', '', $this->url), '/');
         $this->io = $io;
         $this->cache = new Cache($io, $config->get('cache-repo-dir').'/'.preg_replace('{[^a-z0-9.]}i', '-', $this->url), 'a-z0-9.$');
         $this->loader = new ArrayLoader();