fix(domains): reject single-label hostnames for app and service domains

This commit is contained in:
Andras Bacsai
2026-08-28 09:34:10 +02:00
parent b357522f94
commit 1639941da7
4 changed files with 36 additions and 1 deletions
+9 -1
View File
@@ -570,8 +570,16 @@ class ValidationPatterns
continue;
}
if (blank(parse_url($url, PHP_URL_HOST))) {
$host = parse_url($url, PHP_URL_HOST);
if (blank($host)) {
$errors[] = "Invalid URL: {$url}";
continue;
}
$unwrappedHost = trim((string) $host, '[]');
if (! str_contains($unwrappedHost, '.') && filter_var($unwrappedHost, FILTER_VALIDATE_IP) === false) {
$errors[] = "Invalid URL: {$url}. The hostname must be a fully qualified domain name.";
}
}