Fix #4415 and add unit tests for https://bugs.php.net/bug.php?id=51192
diff --git a/tests/codeigniter/libraries/Form_validation_test.php b/tests/codeigniter/libraries/Form_validation_test.php
index 65a3bbf..f455b91 100644
--- a/tests/codeigniter/libraries/Form_validation_test.php
+++ b/tests/codeigniter/libraries/Form_validation_test.php
@@ -231,6 +231,13 @@
$this->assertTrue($this->form_validation->valid_url('www.codeigniter.com'));
$this->assertTrue($this->form_validation->valid_url('http://codeigniter.com'));
+ // https://bugs.php.net/bug.php?id=51192
+ $this->assertTrue($this->form_validation->valid_url('http://accept-dashes.tld'));
+ $this->assertFalse($this->form_validation->valid_url('http://reject_underscores.tld'));
+
+ // https://github.com/bcit-ci/CodeIgniter/issues/4415
+ $this->assertTrue($this->form_validation->valid_url('http://[::1]/ipv6'));
+
$this->assertFalse($this->form_validation->valid_url('htt://www.codeIgniter.com'));
$this->assertFalse($this->form_validation->valid_url(''));
$this->assertFalse($this->form_validation->valid_url('code igniter'));