Website-URLs ohne Protokoll akzeptieren
This commit is contained in:
1 parent
b963b798df
commit
ae741aae61
5 files changed
+39
-3
No files matched your search
@@ -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.');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user