|
@@ 91-93 (lines=3) @@
|
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
if (in_array($operator, ['matchesIPv4', '!matchesIPv4'])) { |
| 91 |
|
if (!filter_var($decodedValue[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { |
| 92 |
|
throw new \UnexpectedValueException($this->l->t('The given IP range is not valid for IPv4'), 3); |
| 93 |
|
} |
| 94 |
|
if ($decodedValue[1] > 32 || $decodedValue[1] <= 0) { |
| 95 |
|
throw new \UnexpectedValueException($this->l->t('The given IP range is not valid for IPv4'), 4); |
| 96 |
|
} |
|
@@ 98-100 (lines=3) @@
|
| 95 |
|
throw new \UnexpectedValueException($this->l->t('The given IP range is not valid for IPv4'), 4); |
| 96 |
|
} |
| 97 |
|
} else { |
| 98 |
|
if (!filter_var($decodedValue[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { |
| 99 |
|
throw new \UnexpectedValueException($this->l->t('The given IP range is not valid for IPv6'), 3); |
| 100 |
|
} |
| 101 |
|
if ($decodedValue[1] > 128 || $decodedValue[1] <= 0) { |
| 102 |
|
throw new \UnexpectedValueException($this->l->t('The given IP range is not valid for IPv6'), 4); |
| 103 |
|
} |