mirror of
https://github.com/php/php-src.git
synced 2024-11-28 20:34:29 +08:00
Merge branch 'PHP-5.5'
* PHP-5.5: NEWS for added reserved ip addresses according to RFC 6598 Add RFC 6598 IPs to reserved addresses
This commit is contained in:
commit
52ff129607
@ -714,6 +714,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
||||
if (flags & FILTER_FLAG_NO_RES_RANGE) {
|
||||
if (
|
||||
(ip[0] == 0) ||
|
||||
(ip[0] == 100 && (ip[1] == 0 || ip[1] <= 127)) ||
|
||||
(ip[0] == 128 && ip[1] == 0) ||
|
||||
(ip[0] == 191 && ip[1] == 255) ||
|
||||
(ip[0] == 169 && ip[1] == 254) ||
|
||||
|
@ -15,6 +15,8 @@ var_dump(filter_var("192.168.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE
|
||||
var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE));
|
||||
var_dump(filter_var("127.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
|
||||
var_dump(filter_var("192.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
|
||||
var_dump(filter_var("100.0.0.0", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
|
||||
var_dump(filter_var("100.127.255.255", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
|
||||
var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP));
|
||||
var_dump(filter_var("256.1237.123.1", FILTER_VALIDATE_IP));
|
||||
var_dump(filter_var("255.255.255.255", FILTER_VALIDATE_IP));
|
||||
@ -40,6 +42,8 @@ bool(false)
|
||||
string(12) "192.0.34.166"
|
||||
bool(false)
|
||||
string(9) "192.0.0.1"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(12) "192.0.34.166"
|
||||
bool(false)
|
||||
string(15) "255.255.255.255"
|
||||
|
Loading…
Reference in New Issue
Block a user