Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IpValidator] disable ipv6 checks #13984

Merged
merged 4 commits into from
Apr 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ Yii Framework 2 Change Log
- Enh #13560: Refactored `\yii\widgets\FragmentCache::getCachedContent()`, added tests (Kolyunya)
- Bug #13901: Fixed passing unused parameter to `formatMessage()` call in `\yii\validators\IpValidator` (Kolyunya)
- Enh #13945: Removed Courier New from error page fonts list since it looks bad on Linux (samdark)
- Bug #13961: RBAC Rules: `PostgreSQL: PHP Warning "unserialize() expects parameter 1 to be string, resource given` was fixed (vsguts)
- Bug #13961: RBAC Rules: PostgreSQL: PHP Warning "unserialize() expects parameter 1 to be string, resource given" was fixed (vsguts)
- Enh #13976: Disabled IPv6 check on `\yii\validators\IpValidator` as it turns out it is not needed for inet_* methods to work (mikk150)
- Enh #13981: `yii\caching\Cache::getOrSet()` now supports both `Closure` and `callable` (silverfire)

2.0.11.2 February 08, 2017
Expand Down
5 changes: 0 additions & 5 deletions framework/validators/IpValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,6 @@ public function init()
if (!$this->ipv4 && !$this->ipv6) {
throw new InvalidConfigException('Both IPv4 and IPv6 checks can not be disabled at the same time');
}

if (!defined('AF_INET6') && $this->ipv6) {
throw new InvalidConfigException('IPv6 validation can not be used. PHP is compiled without IPv6');
}

if ($this->message === null) {
$this->message = Yii::t('yii', '{attribute} must be a valid IP address.');
}
Expand Down
4 changes: 0 additions & 4 deletions tests/framework/validators/IpValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ class IpValidatorTest extends TestCase
{
protected function setUp()
{
if (!defined('AF_INET6')) {
$this->markTestSkipped('The environment does not support IPv6.');
}

parent::setUp();
$this->mockApplication();
}
Expand Down