Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 010084d

Browse files
committed
Merge branch 'hotfix/194'
Close #194 Fixes #193 Fixes #192
2 parents 33caf7f + 11307ea commit 010084d

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5-
## 2.10.1 - TBD
5+
## 2.10.1 - 2017-08-22
66

77
### Added
88

@@ -22,7 +22,10 @@ All notable changes to this project will be documented in this file, in reverse
2222

2323
### Fixed
2424

25-
- Nothing.
25+
- [#194](https://github.com/zendframework/zend-validator/pull/194) modifies the
26+
`EmailAddress` validator to omit the `INTL_IDNA_VARIANT_UTS46` flag to
27+
`idn_to_utf8()` if the constant is not defined, fixing an issue on systems
28+
using pre-2012 releases of libicu.
2629

2730
## 2.10.0 - 2017-08-14
2831

src/EmailAddress.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,10 @@ public function isValid($value)
554554
protected function idnToAscii($email)
555555
{
556556
if (extension_loaded('intl')) {
557-
return (idn_to_ascii($email, 0, INTL_IDNA_VARIANT_UTS46) ?: $email);
557+
if (defined('INTL_IDNA_VARIANT_UTS46')) {
558+
return (idn_to_ascii($email, 0, INTL_IDNA_VARIANT_UTS46) ?: $email);
559+
}
560+
return (idn_to_ascii($email) ?: $email);
558561
}
559562
return $email;
560563
}
@@ -577,7 +580,10 @@ protected function idnToUtf8($email)
577580
// the source string in those cases.
578581
// But not when the source string is long enough.
579582
// Thus we default to source string ourselves.
580-
return idn_to_utf8($email, 0, INTL_IDNA_VARIANT_UTS46) ?: $email;
583+
if (defined('INTL_IDNA_VARIANT_UTS46')) {
584+
return idn_to_utf8($email, 0, INTL_IDNA_VARIANT_UTS46) ?: $email;
585+
}
586+
return idn_to_utf8($email) ?: $email;
581587
}
582588
return $email;
583589
}

src/Hostname.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class Hostname extends AbstractValidator
6969

7070
/**
7171
* Array of valid top-level-domains
72-
* IanaVersion 2017081400
72+
* IanaVersion 2017082200
7373
*
7474
* @see ftp://data.iana.org/TLD/tlds-alpha-by-domain.txt List of all TLDs by domain
7575
* @see http://www.iana.org/domains/root/db/ Official list of supported TLDs

0 commit comments

Comments
 (0)