diff options
author | Thomas Citharel <tcit@tcit.fr> | 2019-01-03 10:03:46 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2019-01-03 10:03:46 +0100 |
commit | c9b588774bf57b0d0f9742b2ca32f2185c4317f1 (patch) | |
tree | a4ce602632f3bbb37a3a2ff38054110dd5238486 /tests | |
parent | 4d8f2c241886d6aebb938d6e6867e1779520b930 (diff) | |
download | nextcloud-server-c9b588774bf57b0d0f9742b2ca32f2185c4317f1.tar.gz nextcloud-server-c9b588774bf57b0d0f9742b2ca32f2185c4317f1.zip |
Allow bracket IPv6 address format inside IPAdress Normalizer
When run with php's build-in server (for instance on localhost:8080), IP provided through $this->server['REMOTE_ADDR'] is [::1], which is not an acceptable format for \inet_pton. This removes the brackets if there's any.
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Security/Normalizer/IpAddressTest.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/lib/Security/Normalizer/IpAddressTest.php b/tests/lib/Security/Normalizer/IpAddressTest.php index 36a48f601d3..97a8737ea9e 100644 --- a/tests/lib/Security/Normalizer/IpAddressTest.php +++ b/tests/lib/Security/Normalizer/IpAddressTest.php @@ -40,6 +40,10 @@ class IpAddressTest extends TestCase { '2001:0db8:85a3:0000:0000:8a2e:0370:7334', '2001:db8:85a3::8a2e:370:7334/128', ], + [ + '[::1]', + '::1/128', + ], ]; } |