浏览代码

Allow notifyUrl to be a complete URL

Jordi Boggiano 13 年之前
父节点
当前提交
d80180c2b9
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/Composer/Repository/ComposerRepository.php

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

@@ -87,7 +87,11 @@ class ComposerRepository extends ArrayRepository implements NotifiableRepository
             $data = $json->read();
 
             if (!empty($data['notify'])) {
-                $this->notifyUrl = preg_replace('{(https?://[^/]+).*}i', '$1' . $data['notify'], $this->url);
+                if ('/' === $data['notify'][0]) {
+                    $this->notifyUrl = preg_replace('{(https?://[^/]+).*}i', '$1' . $data['notify'], $this->url);
+                } else {
+                    $this->notifyUrl = $data['notify'];
+                }
             }
 
             $this->cache->write('packages.json', json_encode($data));