From 11999118a5e3d488c89165eaa1ae15dc99720b60 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 7 Apr 2020 16:04:52 +0200 Subject: [PATCH] Avoid failing on malformed funding info, fixes #8731 --- src/Composer/Command/FundCommand.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Composer/Command/FundCommand.php b/src/Composer/Command/FundCommand.php index 53c915c68..eb60ec577 100644 --- a/src/Composer/Command/FundCommand.php +++ b/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];