[IpValidator] disable ipv6 checks (#13984)

* disable ipv6 checks

* remove empty line

* updated CHANGELOG.md
This commit is contained in:
Mikk Tendermann
2017-04-18 19:06:31 +03:00
committed by Dmitry Naumenko
parent cd8b98bb92
commit 59d3292399
3 changed files with 2 additions and 10 deletions

View File

@ -64,7 +64,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

View File

@ -221,11 +221,6 @@ class IpValidator extends Validator
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.');
}

View File

@ -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();
}