summaryrefslogtreecommitdiffstats
path: root/system/libraries/Form_validation.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2019-05-10 19:29:48 +0200
committerAndrey Andreev <narf@devilix.net>2019-05-10 19:29:48 +0200
commit80c20dcfded0df95457acf5cd9b437d2a268bc85 (patch)
tree01f94158d211a0ac224e7bcbeb1163d8c5c23017 /system/libraries/Form_validation.php
parente3d22a2227f995746ee138218d385a7156d3f827 (diff)
[ci skip] Fix #5755
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r--system/libraries/Form_validation.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 1bd55499a..fdf202010 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -1208,6 +1208,13 @@ class CI_Form_validation {
$str = $matches[2];
}
+ // Apparently, FILTER_VALIDATE_URL doesn't reject digit-only names for some reason ...
+ // See https://github.com/bcit-ci/CodeIgniter/issues/5755
+ if (ctype_digit($str))
+ {
+ return FALSE;
+ }
+
// PHP 7 accepts IPv6 addresses within square brackets as hostnames,
// but it appears that the PR that came in with https://bugs.php.net/bug.php?id=68039
// was never merged into a PHP 5 branch ... https://3v4l.org/8PsSN