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

Support for internationalized email address local part #160

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
862cec3
fixed a bug where empty $email was passed to idn_to_utf8
Exlord Jun 23, 2016
ab625c9
Update EmailAddress.php
Exlord Jun 23, 2016
dcbb971
Update EmailAddress.php
Exlord Jun 23, 2016
6ebf825
Update Code128.php
FraGoTe Jul 18, 2016
5551b3d
Update Code128.php
FraGoTe Jul 18, 2016
5b27d44
Credit card number lengths are extended. fixes #153
mkorkmaz Mar 20, 2017
479f57c
add IsCountable validator, to enforce type and count elements.
abacaphiliac Mar 25, 2017
1016df4
Enable Travis CI slack notifications
geerteltink Mar 29, 2017
1e92244
[BUG] Initialize variable to prevent error when not set
codisart Mar 26, 2017
7f8ab4d
Add support for internationalized email address local part
Xerkus Apr 5, 2017
43dbb2d
IDN for .hr
nidzho Apr 10, 2017
0d562d0
Update Iban.php
max-zu Apr 12, 2017
a2fcedd
Update Iban.php
max-zu Apr 12, 2017
3fc1e66
Ref #7629
philippe-jung Apr 25, 2017
cd6b79c
Ensure `validators` config is honored in non-zend-mvc contexts
weierophinney May 16, 2017
4b9fca2
Use `ValidatorManager`, not `FormElementManager`, as requested servic…
weierophinney May 16, 2017
e29ddaf
Remove unnecessary mocks
weierophinney May 16, 2017
803b791
Added CHANGELOG for #168
weierophinney May 17, 2017
4f62a23
Merge branch 'hotfix/validators-service-config'
weierophinney May 17, 2017
5ba3cdd
Merge branch 'hotfix/validators-service-config' into develop
weierophinney May 17, 2017
179edb7
Merge pull request #159 from xtreamwayz/hotfix/slack-notifications
weierophinney May 17, 2017
d35e364
Do not notify IRC any more.
weierophinney May 17, 2017
6c94abb
Merge branch 'hotfix/159'
weierophinney May 17, 2017
6bb4397
Merge branch 'hotfix/159' into develop
weierophinney May 17, 2017
0c561ab
Merge pull request #94 from Exlord/master
weierophinney May 17, 2017
95c9386
Merge branch 'hotfix/94'
weierophinney May 17, 2017
9ec7f1a
Merge branch 'hotfix/94' into develop
weierophinney May 17, 2017
1fbb4fd
Merge pull request #105 from FraGoTe/patch-1
weierophinney May 17, 2017
c5899d3
Merge branch 'hotfix/105'
weierophinney May 17, 2017
149f6af
Merge branch 'hotfix/105' into develop
weierophinney May 17, 2017
325bae5
Merge pull request #132 from codisart/clean-benign-errors
weierophinney May 17, 2017
40dd80d
Merge branch 'hotfix/132'
weierophinney May 17, 2017
979bd6d
Merge branch 'hotfix/132' into develop
weierophinney May 17, 2017
c38074d
Merge pull request #154 from mkorkmaz/validating-visa-credit-card-num…
weierophinney May 17, 2017
5586da9
Added CHANGELOG for #154
weierophinney May 17, 2017
365ef83
Merge branch 'hotfix/154'
weierophinney May 17, 2017
b23cd62
Merge branch 'hotfix/154' into develop
weierophinney May 17, 2017
bd8fbdd
Merge pull request #162 from nidzho/master
weierophinney May 17, 2017
a769a4c
Added CHANGELOG for #162
weierophinney May 17, 2017
480a434
Merge branch 'hotfix/162'
weierophinney May 17, 2017
7b52198
Merge branch 'hotfix/162' into develop
weierophinney May 17, 2017
89ea5b3
Merge pull request #163 from max-zu/patch-1
weierophinney May 17, 2017
28adfff
Added CHANGELOG for #163
weierophinney May 17, 2017
5784b9c
Merge branch 'hotfix/163'
weierophinney May 17, 2017
fd8c3ed
Merge branch 'hotfix/163' into develop
weierophinney May 17, 2017
6207057
CS fixes per phpcs
weierophinney May 17, 2017
49cf0ae
CS fixes
weierophinney May 17, 2017
687eb4a
CS fixes
weierophinney May 17, 2017
f4303c4
Merge pull request #166 from philippe-jung/philippe-jung-7629
weierophinney May 17, 2017
98ed71c
Merge branch 'hotfix/166'
weierophinney May 17, 2017
7c1ee5e
Merge branch 'hotfix/166' into develop
weierophinney May 17, 2017
cb23008
Revert "Merge pull request #105 from FraGoTe/patch-1"
weierophinney May 17, 2017
3e6d354
Merge branch 'hotfix/code128'
weierophinney May 17, 2017
6c60c41
Merge branch 'hotfix/code128' into develop
weierophinney May 17, 2017
f4fcf42
Updated TLD list
weierophinney May 17, 2017
7b750c5
Merge branch 'hotfix/update-tld'
weierophinney May 17, 2017
af39b1a
Merge branch 'hotfix/update-tld' into develop
weierophinney May 17, 2017
d44a1ab
Added date to 2.9.1 in CHANGELOG
weierophinney May 17, 2017
c9a8160
2.9.1 readiness
weierophinney May 17, 2017
609c866
2.9.1 readiness
weierophinney May 17, 2017
e0eb5cf
Bumped to next dev version (2.9.2)
weierophinney May 17, 2017
438b3a6
Bumped version
weierophinney May 17, 2017
388400f
Bumped version
weierophinney May 17, 2017
33591b6
Fix #165 - Use is_readable() instead of stream_resolve_include_path()
larsnystrom May 23, 2017
9c10775
Corrected Date validator format docs
Jun 15, 2017
9d26add
Adapt .travis.yml to recent ZF standards
Slamdunk Jun 23, 2017
92035a4
Travis: drop HVVM & add PHP 7.2
Slamdunk Jun 23, 2017
1a0717c
Prepare to PHP 7.2
Slamdunk Jun 23, 2017
407ee84
In PHP < 7.2 `0 === count(null)`
Slamdunk Jun 23, 2017
4b61f11
Fix Between validator behavior
codisart Jun 19, 2017
d3a3be6
Fix BC break introduced by 3fc1e66
Jul 18, 2017
616d6c9
Merge pull request #173 from nathanjosiah/fix-158
weierophinney Jul 19, 2017
2746080
Merge branch 'hotfix/173'
weierophinney Jul 19, 2017
6500014
Merge branch 'hotfix/173' into develop
weierophinney Jul 19, 2017
39a64e6
Updates Hostname IDN list
weierophinney Jul 19, 2017
268a704
Merge branch 'hotfix/hostname-idn-update'
weierophinney Jul 19, 2017
bf7be0d
Merge branch 'hotfix/hostname-idn-update' into develop
weierophinney Jul 19, 2017
1b7725e
Merge pull request #180 from ThomasCantonnet/finfo-bc-break
weierophinney Jul 19, 2017
a56abf9
Adds CHANGELOG for #180
weierophinney Jul 19, 2017
8a34a5a
Merge branch 'hotfix/180'
weierophinney Jul 19, 2017
f012441
Merge branch 'hotfix/180' into develop
weierophinney Jul 19, 2017
5de3f0d
Updates Travis configuration to remove unneeded functionality
weierophinney Jul 19, 2017
ce7ab72
Merge branch 'hotfix/travis'
weierophinney Jul 19, 2017
d7b8d55
Merge branch 'hotfix/travis' into develop
weierophinney Jul 19, 2017
8f08111
Merge pull request #174 from codisart/issue-167
weierophinney Jul 20, 2017
3cda0ad
Updates `providerBasic` to do one value per set
weierophinney Jul 20, 2017
d2b5636
Provides validation error messages for Between validator type mismatch
weierophinney Jul 20, 2017
8729b71
Added CHANGELOG for #174
weierophinney Jul 20, 2017
48c80ce
Merge branch 'hotfix/174'
weierophinney Jul 20, 2017
9a7c40c
Merge branch 'hotfix/174' into develop
weierophinney Jul 20, 2017
754c62f
Adds date for 2.9.2 to CHANGELOG
weierophinney Jul 20, 2017
a58dbe8
2.9.2 readiness
weierophinney Jul 20, 2017
13f88a4
2.9.2 readiness
weierophinney Jul 20, 2017
b91f8e3
Updated hostname validator TLD list
weierophinney Jul 20, 2017
58da575
Updated hostname validator TLD list
weierophinney Jul 20, 2017
83aa8e5
Merge pull request #169 from larsnystrom/hotfix/165
weierophinney Jul 25, 2017
4416265
Updates `@return` annotations for fluent interfaces
weierophinney Jul 25, 2017
ddcb7cd
Adds CHANGELOG for #169
weierophinney Jul 25, 2017
e44ce14
Merge branch 'feature/169' into develop
weierophinney Jul 25, 2017
7b3c9ac
Updated Hostname validator TLD list
weierophinney Jul 25, 2017
8d4989d
Merge branch 'hotfix/hostname-tld' into develop
weierophinney Jul 25, 2017
809093c
Merge pull request #175 from Slamdunk/php_72
weierophinney Jul 25, 2017
d0316a1
Provides CS fix for update_hostname_validator
weierophinney Jul 25, 2017
6120357
Provides formatting of complex conditional
weierophinney Jul 25, 2017
af974c9
Adds CHANGELOG for #175
weierophinney Jul 25, 2017
93601c7
Merge branch 'feature/175' into develop
weierophinney Jul 25, 2017
e7355ab
Updates zend-session requirement
weierophinney Jul 25, 2017
f527802
address upstream feedback: remove setters, prefer count over min and …
abacaphiliac Jul 26, 2017
9924700
Adds CHANGELOG for #185
weierophinney Jul 26, 2017
b83a91f
Merge branch 'feature/zend-session-php-7.2-compat' into develop
weierophinney Jul 26, 2017
1dc79e6
Merge pull request #157 from abacaphiliac/master
weierophinney Jul 26, 2017
74b4711
Adds license docblocks to new class files
weierophinney Jul 26, 2017
88831e1
Imports `Countable` into `IsCountable` class file
weierophinney Jul 26, 2017
97d297c
Updates IsCountable to not allow passing both a count and a min or ma…
weierophinney Jul 26, 2017
03c12fd
Adds documentation for #157
weierophinney Jul 26, 2017
e9ac470
Adds CHANGELOG for #157
weierophinney Jul 26, 2017
3414136
Merge branch 'feature/157' into develop
weierophinney Jul 26, 2017
14fb107
Merge pull request #160 from Xerkus/hotfix/internationalized-local-part
weierophinney Jul 26, 2017
360379d
Refactors `validateInternationalizedLocalPart()` to accept the local …
weierophinney Jul 26, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 6 additions & 34 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,14 @@ branches:

cache:
directories:
- $HOME/.composer/cache
- $HOME/.local
- zf-mkdoc-theme
- $HOME/.composer/

env:
global:
- COMPOSER_ARGS="--no-interaction"
- COVERAGE_DEPS="satooshi/php-coveralls"
- LEGACY_DEPS="phpunit/phpunit"
- TESTS_ZEND_VALIDATOR_ONLINE_ENABLED=true
- SITE_URL=https://zendframework.github.io/zend-validator
- GH_USER_NAME="Matthew Weier O'Phinney"
- GH_USER_EMAIL=matthew@weierophinney.net
- GH_REF=github.com/zendframework/zend-validator.git
- secure="SoUsUxBFCuC0rVQyDJ/+IB38glC5WeWvg0XxtNj79di7wsQ92Jofp6Uu3NJBB8H1+at1pHetphRm4N+GPQmZGMFTG7LyF5u8duV8t4nDpAz5WfoP1y0IyacP6IrWzANeszOTZ04dlHu3dBdHusNpNxxUHl97bSx4XQUAm2GUTqNkuXNgQJFAAxx91jb5txG4W8KeMnfRm9jeDHP17BCnBMaSkYEXeLpHkYa9wA4lBJ7ZD6LuSC+MhrJCtREBTsWKLJY6xeBjRorUug+uCrNyArPtcOAaOLMSDJ1XIi3L5/Q7HdoldV7aC3V5HjNlpdIEFl33IGiCOyictFCpT1KaKx7TL8zDTMCiqe0cCyfTnq28lzULz2hXg0Kov7BFcRr2Ht/1f96RgrakWQiYTmk+C3YYYA16Fb+MndkMI3WH7WI0suC+5nhPdGl53MCWsd5x2+dDk/ifB/VvxHdGhhgxzAxsYJ41gV/LlzjbCQJNDCnTaL/GHCTUGJEPgwLrn2W52uZx6VggE9wl5z4XkiPqBy6zAAdwF55RRJgCxFttGOMVGdegFLHTf6+13S4sEImNmyVTeuJBZEHxaYRJ21wweOocjC2StKC9V54uPysDcEYwhu8WOsYU34fQdpMx3OHfPmXvhNGqoZ1rVsd5HM0QZZMT+7SI0r3UNKxrPC8LEAU="

matrix:
include:
Expand All @@ -35,12 +28,6 @@ matrix:
- DEPS=locked
- EXECUTE_HOSTNAME_CHECK=true
- TEST_COVERAGE=true
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
- PATH="$HOME/.local/bin:$PATH"
- php: 5.6
env:
- DEPS=locked
- SERVICE_MANAGER_VERSION="^2.7.5"
- php: 5.6
env:
- DEPS=latest
Expand All @@ -51,10 +38,6 @@ matrix:
env:
- DEPS=locked
- CS_CHECK=true
- php: 7
env:
- DEPS=locked
- SERVICE_MANAGER_VERSION="^2.7.5"
- php: 7
env:
- DEPS=latest
Expand All @@ -67,21 +50,17 @@ matrix:
- php: 7.1
env:
- DEPS=latest
- php: hhvm
- php: nightly
env:
- DEPS=lowest
- php: hhvm
- php: nightly
env:
- DEPS=locked
- php: hhvm
- php: nightly
env:
- DEPS=latest
- php: hhvm
env:
- DEPS=locked
- SERVICE_MANAGER_VERSION="^2.7.5"
allow_failures:
- php: hhvm
- php: nightly

before_install:
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
Expand All @@ -92,8 +71,6 @@ install:
- if [[ $TRAVIS_PHP_VERSION =~ ^5.6 ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
- if [[ $SERVICE_MANAGER_VERSION != '' ]]; then travis_retry composer require --dev --no-update $COMPOSER_ARGS "zendframework/zend-servicemanager:$SERVICE_MANAGER_VERSION" ; fi
- if [[ $SERVICE_MANAGER_VERSION == '' ]]; then travis_retry composer require --dev --no-update $COMPOSER_ARGS "zendframework/zend-servicemanager:^3.0.3" ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
- stty cols 120
- COLUMNS=120 composer show
Expand All @@ -102,14 +79,9 @@ script:
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi
- if [[ $EXECUTE_HOSTNAME_CHECK == "true" && $TRAVIS_PULL_REQUEST == "false" ]]; then php bin/update_hostname_validator.php --check-only; fi
- if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then wget -O theme-installer.sh "https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh" ; chmod 755 theme-installer.sh ; ./theme-installer.sh ; fi

after_script:
- if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi

after_success:
- if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./zf-mkdoc-theme/deploy.sh ; echo "Completed deploying documentation" ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer upload-coverage ; fi

notifications:
irc: "irc.freenode.org#zftalk.dev"
email: false
69 changes: 66 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,43 @@ All notable changes to this project will be documented in this file, in reverse

### Added

- Nothing.
- [#175](https://github.com/zendframework/zend-validator/pull/175) adds support
for PHP 7.2 (conditionally, as PHP 7.2 is currently in beta1).

- [#157](https://github.com/zendframework/zend-validator/pull/157) adds a new
validator, `IsCountable`, which allows validating:
- if a value is countable
- if a countable value exactly matches a configured count
- if a countable value is greater than a configured minimum count
- if a countable value is less than a configured maximum count
- if a countable value is between configured minimum and maximum counts

### Changed

- [#169](https://github.com/zendframework/zend-validator/pull/169) modifies how
the various `File` validators check for readable files. Previously, they used
`stream_resolve_include_path`, which led to false negative checks when the
files did not exist within an `include_path` (which is often the case within a
web application). These now use `is_readable()` instead.

- [#185](https://github.com/zendframework/zend-validator/pull/185) updates the
zend-session requirement (during development, and in the suggestions) to 2.8+,
to ensure compatibility with the upcoming PHP 7.2 release.

### Deprecated

- Nothing.

### Removed

- Nothing.
- [#175](https://github.com/zendframework/zend-validator/pull/175) removes
support for HHVM.

### Fixed

- Nothing.

## 2.9.1 - TBD
## 2.9.2 - 2017-07-20

### Added

Expand All @@ -36,8 +58,49 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

- [#180](https://github.com/zendframework/zend-validator/pull/180) fixes how
`Zend\Validator\File\MimeType` "closes" the open FileInfo handle for the file
being validated, using `unset()` instead of `finfo_close()`; this resolves a
segfault that occurs on older PHP versions.
- [#174](https://github.com/zendframework/zend-validator/pull/174) fixes how
`Zend\Validator\Between` handles two situations: (1) when a non-numeric value
is validated against numeric min/max values, and (2) when a numeric value is
validated against non-numeric min/max values. Previously, these incorrectly
validated as true; now they are marked invalid.

## 2.9.1 - 2017-05-17

### Added

- Nothing.

### Changes

- [#154](https://github.com/zendframework/zend-validator/pull/154) updates the
`CreditCard` validator to allow 19 digit Discover card values, and 13 and 19
digit Visa card values, which are now allowed (see
https://en.wikipedia.org/wiki/Payment_card_number).
- [#162](https://github.com/zendframework/zend-validator/pull/162) updates the
`Hostname` validator to support `.hr` (Croatia) IDN domains.
- [#163](https://github.com/zendframework/zend-validator/pull/163) updates the
`Iban` validator to support Belarus.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- [#168](https://github.com/zendframework/zend-validator/pull/168) fixes how the
`ValidatorPluginManagerFactory` factory initializes the plugin manager instance,
ensuring it is injecting the relevant configuration from the `config` service
and thus seeding it with configured validator services. This means
that the `validators` configuration will now be honored in non-zend-mvc contexts.

## 2.9.0 - 2017-03-17

### Added
Expand Down
4 changes: 3 additions & 1 deletion bin/update_hostname_validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ function getNewValidTlds($string)
function getPunycodeDecoder()
{
if (function_exists('idn_to_utf8')) {
return 'idn_to_utf8';
return function ($domain) {
return idn_to_utf8($domain, 0, INTL_IDNA_VARIANT_UTS46);
};
}

$hostnameValidator = new Hostname();
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"zendframework/zend-i18n": "^2.6",
"zendframework/zend-math": "^2.6",
"zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",
"zendframework/zend-session": "^2.6.2",
"zendframework/zend-session": "^2.8",
"zendframework/zend-uri": "^2.5",
"phpunit/PHPUnit": "^6.0.8 || ^5.7.15",
"zendframework/zend-coding-standard": "~1.0.0"
Expand All @@ -38,7 +38,7 @@
"zendframework/zend-math": "Zend\\Math component, required by the Csrf validator",
"zendframework/zend-i18n-resources": "Translations of validator messages",
"zendframework/zend-servicemanager": "Zend\\ServiceManager component to allow using the ValidatorPluginManager and validator chains",
"zendframework/zend-session": "Zend\\Session component, required by the Csrf validator",
"zendframework/zend-session": "Zend\\Session component, ^2.8; required by the Csrf validator",
"zendframework/zend-uri": "Zend\\Uri component, required by the Uri and Sitemap\\Loc validators"
},
"minimum-stability": "dev",
Expand Down
22 changes: 11 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion doc/book/validators/date.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $validator->isValid('10.10.2000'); // returns false

`Zend\Validator\Date` also supports custom date formats. When you want to
validate such a date, use the `format` option. This option accepts any format
allowed by the PHP [date()](http://php.net/date) function.
allowed by the PHP [DateTime::createFromFormat()](http://php.net/manual/en/datetime.createfromformat.php#refsect1-datetime.createfromformat-parameters) method.

```php
$validator = new Zend\Validator\Date(['format' => 'Y']);
Expand Down
Loading