rework validateUrl(), refs #1325

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2025-04-24 09:56:03 +02:00
parent 76793c8992
commit d9032f3790
2 changed files with 45 additions and 23 deletions

View File

@@ -142,6 +142,12 @@ class ValidateTest extends TestCase
$this->assertFalse($result);
$result = Validate::validateUrl("172.16.0.1:8080", true);
$this->assertTrue($result);
$result = Validate::validateUrl("https://xn--frxlr-kuac.de/", true);
$this->assertTrue($result);
$result = Validate::validateUrl("https://2a10:ec2::193:107:51:5/test");
$this->assertFalse($result);
$result = Validate::validateUrl("https://[2a10:ec2::193:107:51:5]");
$this->assertTrue($result);
}
public function testValidateDomain()