Website-URLs ohne Protokoll akzeptieren

This commit is contained in:
gitea_admin committed 2026-09-27 13:48:29 +02:00
1 parent b963b798df
commit ae741aae61
5 files changed
+39 -3

No files matched your search

+4
View File
@@ -352,6 +352,10 @@ function market_management_optional_url(array $input, string $field): ?string
return null;
}
if (!preg_match('/^https?:\/\//i', $value)) {
$value = 'https://' . $value;
}
if (filter_var($value, FILTER_VALIDATE_URL) === false || !preg_match('/^https?:\/\//i', $value)) {
throw new InvalidArgumentException($field . ' muss eine gültige HTTP(S)-URL sein.');
}