summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/libraries/Email.php2
-rw-r--r--system/libraries/Form_validation.php2
-rw-r--r--user_guide_src/source/changelog.rst6
3 files changed, 8 insertions, 2 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 6a8bda70e..967a0019a 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -1035,7 +1035,7 @@ class CI_Email {
if (function_exists('idn_to_ascii') && strpos($email, '@'))
{
list($account, $domain) = explode('@', $email, 2);
- $domain = is_php('5.4')
+ $domain = defined('INTL_IDNA_VARIANT_UTS46')
? idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46)
: idn_to_ascii($domain);
$email = $account.'@'.$domain;
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;
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 686f9b83e..f74308342 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -7,6 +7,12 @@ Version 3.1.8
Release Date: Not Released
+- General Changes
+
+Bug fixes for 3.1.8
+-------------------
+
+- Fixed a bug where :doc:`Form Validation Library <libraries/form_validation>`, :doc:`Email Library <libraries/email>` tried to use ``INTL_IDNA_VARIANT_UTS46`` when it was undeclared.
Version 3.1.7
=============