Explorar o código

Avoid failing on malformed funding info, fixes #8731

Jordi Boggiano %!s(int64=5) %!d(string=hai) anos
pai
achega
11999118a5
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/Composer/Command/FundCommand.php

+ 4 - 0
src/Composer/Command/FundCommand.php

@@ -91,6 +91,10 @@ class FundCommand extends BaseCommand
     {
         foreach ($package->getFunding() as $fundingOption) {
             list($vendor, $packageName) = explode('/', $package->getPrettyName());
+            // ignore malformed funding entries
+            if (empty($fundingOption['url'])) {
+                continue;
+            }
             $url = $fundingOption['url'];
             if (!empty($fundingOption['type']) && $fundingOption['type'] === 'github' && preg_match('{^https://github.com/([^/]+)$}', $url, $match)) {
                 $url = 'https://github.com/sponsors/'.$match[1];