fix: Add final . for domain lookup

This commit is contained in:
overflowerror 2023-12-03 13:59:51 +01:00
parent 541100e6ac
commit 099c85ef7b

View file

@ -36,6 +36,11 @@ function validateInput(string $url) {
$matches
);
$hostname = $matches[1] ?? null;
if ($hostname[strlen($hostname) - 1] != ".") {
// add . so DNS lookup won't fail
$hostname .= ".";
}
$matches = [];
preg_match(
"/^.*?:\/\/([0-9:.]+).*$/",