浏览代码

Increase subnet matcher

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
tags/v22.0.0beta1
Lukas Reschke 3 年前
父节点
当前提交
e5a4236e68
共有 2 个文件被更改,包括 12 次插入4 次删除
  1. 2
    2
      lib/private/Security/Normalizer/IpAddress.php
  2. 10
    2
      tests/lib/Security/Normalizer/IpAddressTest.php

+ 2
- 2
lib/private/Security/Normalizer/IpAddress.php 查看文件

@@ -93,7 +93,7 @@ class IpAddress {
}

/**
* Gets either the /32 (IPv4) or the /128 (IPv6) subnet of an IP address
* Gets either the /32 (IPv4) or the /64 (IPv6) subnet of an IP address
*
* @return string
*/
@@ -106,7 +106,7 @@ class IpAddress {
}
return $this->getIPv6Subnet(
$this->ip,
128
64
);
}


+ 10
- 2
tests/lib/Security/Normalizer/IpAddressTest.php 查看文件

@@ -37,11 +37,19 @@ class IpAddressTest extends TestCase {
],
[
'2001:0db8:85a3:0000:0000:8a2e:0370:7334',
'2001:db8:85a3::8a2e:370:7334/128',
'2001:db8:85a3::/64',
],
[
'2001:db8:3333:4444:5555:6666:7777:8888',
'2001:db8:3333:4444::/64',
],
[
'::1234:5678',
'::/64',
],
[
'[::1]',
'::1/128',
'::/64',
],
];
}

正在加载...
取消
保存