diff options
author | Andrey Andreev <narf@devilix.net> | 2016-08-10 14:26:57 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2016-08-10 14:26:57 +0200 |
commit | c4bd43432df03e4f4835c7689c8ed722cd2c3020 (patch) | |
tree | 5603166833d78b0581bbe880adb53b6de085719d /system/libraries/Form_validation.php | |
parent | 488ad40ba334ca506f07bede97724726eac2b27f (diff) | |
parent | 9180a1264dc536c34e5cc8a0e44bb399a8ba484f (diff) |
Merge branch '3.1-stable' into develop
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r-- | system/libraries/Form_validation.php | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index d5f67d1da..61f0298fd 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1216,18 +1216,7 @@ class CI_Form_validation { $str = 'ipv6.host'.substr($str, strlen($matches[1]) + 2); } - $str = 'http://'.$str; - - // There's a bug affecting PHP 5.2.13, 5.3.2 that considers the - // underscore to be a valid hostname character instead of a dash. - // Reference: https://bugs.php.net/bug.php?id=51192 - if (version_compare(PHP_VERSION, '5.2.13', '==') OR version_compare(PHP_VERSION, '5.3.2', '==')) - { - sscanf($str, 'http://%[^/]', $host); - $str = substr_replace($str, strtr($host, array('_' => '-', '-' => '_')), 7, strlen($host)); - } - - return (filter_var($str, FILTER_VALIDATE_URL) !== FALSE); + return (filter_var('http://'.$str, FILTER_VALIDATE_URL) !== FALSE); } // -------------------------------------------------------------------- |