1
0
Fork 0
composer/tests
Andrew Nicols 811dfd3a13
Support schemeless funding URLs
The [GitHub documentation][1] for FUNDING.yml specifically notes that if a
custom URL is in the Array format, and includes `:` then it must be
quoted.

From this we can infer that the custom URL does not have to contain a
`:` at all.

The example for a Custom URL also gives an example of an unquoted URL
without any `:` character:

```
custom: ["https://www.paypal.me/octocat", octocat.com]
```

However if a repository uses a URL in this format it is currently
rejected because it does not specify a scheme. Furthermore the
`parse_url` method treats the `octocat.com` example as a path and not a
host. The same is true for URLs such as
`octocat.com/funding/example.html`.

This patch adds an additional allowance for the URL filter to capture
the case where a URL has no scheme or host, but does have a path.

[1]: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository#about-funding-files
2024-12-17 22:22:26 +08:00
..
Composer/Test Support schemeless funding URLs 2024-12-17 22:22:26 +08:00
bootstrap.php Disable color output in tests by default to avoid issues on windows, fixes #11598 2023-08-30 15:02:59 +02:00
complete.phpunit.xml Exclude PHPStan extensions from PHPUnit coverage 2023-01-03 18:57:00 +11:00
console-application.php Fix a bunch of type errors in SelfUpdateCommand, fixes #10696, closes #10704 2022-04-06 21:35:26 +02:00