Procházet zdrojové kódy

Allow notifyUrl to be a complete URL

Jordi Boggiano před 13 roky
rodič
revize
d80180c2b9
1 změnil soubory, kde provedl 5 přidání a 1 odebrání
  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));