Annotation of embedaddon/php/ext/filter/tests/bug47435.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #47435 (FILTER_FLAG_NO_PRIV_RANGE and FILTER_FLAG_NO_RES_RANGE don't work with ipv6)
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("filter")) die("skip"); ?>
! 5: --FILE--
! 6: <?php
! 7: var_dump(filter_var("FC00::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
! 8: var_dump(filter_var("FC00::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 | FILTER_FLAG_NO_PRIV_RANGE));
! 9: var_dump(filter_var("::", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
! 10: var_dump(filter_var("::", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 | FILTER_FLAG_NO_RES_RANGE));
! 11: var_dump(filter_var("::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
! 12: var_dump(filter_var("::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 | FILTER_FLAG_NO_RES_RANGE));
! 13: var_dump(filter_var("fe8:5:6::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
! 14: var_dump(filter_var("fe8:5:6::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 | FILTER_FLAG_NO_RES_RANGE));
! 15: var_dump(filter_var("2001:0db8::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
! 16: var_dump(filter_var("2001:0db8::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 | FILTER_FLAG_NO_RES_RANGE));
! 17: var_dump(filter_var("5f::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
! 18: var_dump(filter_var("5f::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 | FILTER_FLAG_NO_RES_RANGE));
! 19: var_dump(filter_var("3ff3::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
! 20: var_dump(filter_var("3ff3::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 | FILTER_FLAG_NO_RES_RANGE));
! 21: ?>
! 22: --EXPECT--
! 23: string(7) "FC00::1"
! 24: bool(false)
! 25: string(2) "::"
! 26: bool(false)
! 27: string(3) "::1"
! 28: bool(false)
! 29: string(10) "fe8:5:6::1"
! 30: bool(false)
! 31: string(12) "2001:0db8::1"
! 32: bool(false)
! 33: string(5) "5f::1"
! 34: bool(false)
! 35: string(7) "3ff3::1"
! 36: bool(false)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>