We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a7ba62 commit 44dee6aCopy full SHA for 44dee6a
src/Helpers.php
@@ -57,7 +57,7 @@ public static function getBaseUrl(): ?string
57
*/
58
public static function safeUrl(string $s): string
59
{
60
- if (strncmp($s, 'http', 4) !== 0) {
+ if (strncmp(strtolower($s), 'http', 4) !== 0) {
61
$s = 'http://' . $s;
62
}
63
@@ -68,7 +68,7 @@ public static function safeUrl(string $s): string
68
public static function parseDomain(string $url): string
69
70
$domainPattern = '/^(?:https?:\/\/)?(?<subdomain>[^\/]*?)(?<domain>localhost|(?:\d{1,3}\.?){4}|(?:(?:[a-z0-9-]+)\.(?:[a-z0-9-]+)))(?:\/|$)/';
71
- if (preg_match($domainPattern, $url, $parser)) {
+ if (preg_match($domainPattern, strtolower($url), $parser)) {
72
return (string) ($parser['domain'] ?? '');
73
74
0 commit comments