Skip to content

Commit 48a0c3c

Browse files
leofeyerausi
andauthored
Improve the regex
Co-authored-by: Martin Auswöger <martin@auswoeger.com>
1 parent 52e85cd commit 48a0c3c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core-bundle/src/Resources/contao/dca/tl_page.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,9 +1289,9 @@ public function checkDns($varValue)
12891289

12901290
// The first part will match IPv6 addresses in square brackets. The
12911291
// second part will match domain names and IPv4 addresses.
1292-
preg_match('#(?:^(?:[a-z]+]://)?(\[[0-9a-f:]+]))|(?:^(?:[a-z]+://)?([\pN\pL._-]*))#ui', $varValue, $matches);
1292+
preg_match('#^(?:[a-z]+://)?(\[[0-9a-f:]+]|[\pN\pL._-]*)#ui', $varValue, $matches);
12931293

1294-
return Idna::encode($matches[2] ?? $matches[1]);
1294+
return Idna::encode($matches[1]);
12951295
}
12961296

12971297
/**

0 commit comments

Comments
 (0)