Update to Drupal 8.0-dev-2015-11-17. Commits through da81cd220, Tue Nov 17 15:53:49 2015 +0000, Issue #2617224 by Wim Leers: Move around/fix some documentation.

This commit is contained in:
Pantheon Automation 2015-11-17 13:42:33 -08:00 committed by Greg Anderson
parent 4afb23bbd3
commit 7784f4c23d
929 changed files with 19798 additions and 5304 deletions

View file

@ -57,18 +57,19 @@ class IpUtils
* @param string $requestIp IPv4 address to check
* @param string $ip IPv4 address or subnet in CIDR notation
*
* @return bool Whether the IP is valid
* @return bool Whether the request IP matches the IP, or whether the request IP is within the CIDR subnet.
*/
public static function checkIp4($requestIp, $ip)
{
if (false !== strpos($ip, '/')) {
if ('0.0.0.0/0' === $ip) {
return true;
}
list($address, $netmask) = explode('/', $ip, 2);
if ($netmask < 1 || $netmask > 32) {
if ($netmask === '0') {
// Ensure IP is valid - using ip2long below implicitly validates, but we need to do it manually here
return filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
}
if ($netmask < 0 || $netmask > 32) {
return false;
}
} else {