From 221c09588be796ba352683cd7814af33501d4fa6 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 22 Jan 2018 10:29:19 +0200 Subject: Fix a bug where INTL_IDNA_VARIANT_UTS46 was used while undeclared The constant was introduced in PHP 5.4, and is documented that way, but it actually depends on PHP being linked to ICU 4.6+, while the minimum requirement for compilation is 4.0 ... When this happens on PHP 7.2, an E_DEPRECATED notice will be emitted; there's currently a discussion on php-internals to resolve that issue. --- system/libraries/Form_validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Form_validation.php') diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 3444c65a0..6a97ee599 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1231,7 +1231,7 @@ class CI_Form_validation { { if (function_exists('idn_to_ascii') && preg_match('#\A([^@]+)@(.+)\z#', $str, $matches)) { - $domain = is_php('5.4') + $domain = defined('INTL_IDNA_VARIANT_UTS46') ? idn_to_ascii($matches[2], 0, INTL_IDNA_VARIANT_UTS46) : idn_to_ascii($matches[2]); $str = $matches[1].'@'.$domain; -- cgit v1.2.3-24-g4f1b