Skip to content

Commit

Permalink
Larger character set for domain names (#11)
Browse files Browse the repository at this point in the history
Domain names can include much more characters than just `a-z`, but also `A-Z`, `0-9`, and `_`.
  • Loading branch information
LeoColomb authored Feb 28, 2021
1 parent e1f111e commit 7713e0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Provider/GitHubProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function fetchFromUrl(string $url): string

private function getUrl(string $url): string
{
$domain = preg_replace('/https?:\/\/(www\.)?([a-z\-\.]+)\/?.*/i', '$2', $url);
$domain = preg_replace('/https?:\/\/(www\.)?([\w\-\.]+)\/?.*/i', '$2', $url);

return 'https://favicons.githubusercontent.com/'.urlencode($domain);
}
Expand Down

0 comments on commit 7713e0c

Please sign in to comment.