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

Commit

Permalink
Merge branch 'hotfix/194'
Browse files Browse the repository at this point in the history
Close #194
Fixes #193
Fixes #192
  • Loading branch information
weierophinney committed Aug 22, 2017
2 parents 33caf7f + 11307ea commit 010084d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

## 2.10.1 - TBD
## 2.10.1 - 2017-08-22

### Added

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

### Fixed

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

## 2.10.0 - 2017-08-14

Expand Down
10 changes: 8 additions & 2 deletions src/EmailAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,10 @@ public function isValid($value)
protected function idnToAscii($email)
{
if (extension_loaded('intl')) {
return (idn_to_ascii($email, 0, INTL_IDNA_VARIANT_UTS46) ?: $email);
if (defined('INTL_IDNA_VARIANT_UTS46')) {
return (idn_to_ascii($email, 0, INTL_IDNA_VARIANT_UTS46) ?: $email);
}
return (idn_to_ascii($email) ?: $email);
}
return $email;
}
Expand All @@ -577,7 +580,10 @@ protected function idnToUtf8($email)
// the source string in those cases.
// But not when the source string is long enough.
// Thus we default to source string ourselves.
return idn_to_utf8($email, 0, INTL_IDNA_VARIANT_UTS46) ?: $email;
if (defined('INTL_IDNA_VARIANT_UTS46')) {
return idn_to_utf8($email, 0, INTL_IDNA_VARIANT_UTS46) ?: $email;
}
return idn_to_utf8($email) ?: $email;
}
return $email;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Hostname.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Hostname extends AbstractValidator

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

0 comments on commit 010084d

Please sign in to comment.