mirror of
https://github.com/composer/composer
synced 2025-05-10 00:53:06 +00:00
Avoid failing on malformed funding info, fixes #8731
This commit is contained in:
parent
96c1ba279a
commit
11999118a5
1 changed files with 4 additions and 0 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue