Allow using short form URLs like foo.com if they are very simple
parent
7b261bdf53
commit
924527cda6
|
@ -301,6 +301,11 @@ class GitHubDriver extends VcsDriver
|
|||
}
|
||||
|
||||
if (!array_key_exists('scheme', $bits) && !array_key_exists('host', $bits)) {
|
||||
if (Preg::isMatch('{^[a-z0-9-]++\.[a-z]{2,3}$}', $item['url'])) {
|
||||
$result[$key]['url'] = 'https://'.$item['url'];
|
||||
break;
|
||||
}
|
||||
|
||||
$this->io->writeError('<warning>Funding URL '.$item['url'].' not in a supported format.</warning>');
|
||||
unset($result[$key]);
|
||||
break;
|
||||
|
|
|
@ -288,11 +288,21 @@ class GitHubDriverTest extends TestCase
|
|||
return [
|
||||
[
|
||||
'custom: example.com',
|
||||
null,
|
||||
[
|
||||
[
|
||||
'type' => 'custom',
|
||||
'url' => 'https://example.com',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'custom: [example.com]',
|
||||
null,
|
||||
[
|
||||
[
|
||||
'type' => 'custom',
|
||||
'url' => 'https://example.com',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'custom: "https://example.com"',
|
||||
|
@ -319,6 +329,10 @@ class GitHubDriverTest extends TestCase
|
|||
'type' => 'custom',
|
||||
'url' => 'https://example.com',
|
||||
],
|
||||
[
|
||||
'type' => 'custom',
|
||||
'url' => 'https://example.org',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
|
@ -328,6 +342,10 @@ class GitHubDriverTest extends TestCase
|
|||
'type' => 'custom',
|
||||
'url' => 'https://example.com',
|
||||
],
|
||||
[
|
||||
'type' => 'custom',
|
||||
'url' => 'https://example.org',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue