allow domain-redirect to internal-ipaddress

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-12-20 17:20:40 +01:00
parent 24fa1d39ed
commit 2dd226c96c
4 changed files with 31 additions and 4 deletions

View File

@@ -120,18 +120,28 @@ class ValidateTest extends TestCase
{
$result = Validate::validateUrl("https://froxlor.org/");
$this->assertTrue($result);
$result = Validate::validateUrl("https://froxlor.org/", true);
$this->assertTrue($result);
$result = Validate::validateUrl("http://forum.froxlor.org/");
$this->assertTrue($result);
$result = Validate::validateUrl("https://api.froxlor.org/doc/0.10.0/index.php");
$this->assertTrue($result);
$result = Validate::validateUrl("https://api.froxlor.org/doc/0.10.0/index.php", true);
$this->assertTrue($result);
$result = Validate::validateUrl("#froxlor");
$this->assertFalse($result);
$result = Validate::validateUrl("https://82.149.225.211/");
$this->assertTrue($result);
$result = Validate::validateUrl("https://82.149.225.211/", true);
$this->assertTrue($result);
$result = Validate::validateUrl("https://82.149.225.300");
$this->assertFalse($result);
$result = Validate::validateUrl("82.149.225.211:443");
$this->assertTrue($result);
$result = Validate::validateUrl("172.16.0.1:8080");
$this->assertFalse($result);
$result = Validate::validateUrl("172.16.0.1:8080", true);
$this->assertTrue($result);
}
public function testValidateDomain()