equal
deleted
inserted
replaced
750 $cookies[] = new WP_Http_Cookie( $value, $url ); |
750 $cookies[] = new WP_Http_Cookie( $value, $url ); |
751 } |
751 } |
752 } |
752 } |
753 |
753 |
754 // Cast the Response Code to an int. |
754 // Cast the Response Code to an int. |
755 $response['code'] = intval( $response['code'] ); |
755 $response['code'] = (int) $response['code']; |
756 |
756 |
757 return array( |
757 return array( |
758 'response' => $response, |
758 'response' => $response, |
759 'headers' => $newheaders, |
759 'headers' => $newheaders, |
760 'cookies' => $cookies, |
760 'cookies' => $cookies, |
1074 * @link http://home.deds.nl/~aeron/regex/ for IPv6 regex. |
1074 * @link http://home.deds.nl/~aeron/regex/ for IPv6 regex. |
1075 * |
1075 * |
1076 * @since 3.7.0 |
1076 * @since 3.7.0 |
1077 * |
1077 * |
1078 * @param string $maybe_ip A suspected IP address. |
1078 * @param string $maybe_ip A suspected IP address. |
1079 * @return integer|bool Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure |
1079 * @return int|false Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure |
1080 */ |
1080 */ |
1081 public static function is_ip_address( $maybe_ip ) { |
1081 public static function is_ip_address( $maybe_ip ) { |
1082 if ( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $maybe_ip ) ) { |
1082 if ( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $maybe_ip ) ) { |
1083 return 4; |
1083 return 4; |
1084 } |
1084 } |