Index: src/wp-includes/class-http.php
===================================================================
--- src/wp-includes/class-http.php	(revision 35580)
+++ src/wp-includes/class-http.php	(working copy)
@@ -843,7 +843,7 @@
 	 * @return integer|bool Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure
 	 */
 	public static function is_ip_address( $maybe_ip ) {
-		if ( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $maybe_ip ) )
+		if ( preg_match( '/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/', $maybe_ip ) )
 			return 4;
 
 		if ( false !== strpos( $maybe_ip, ':' ) && preg_match( '/^(((?=.*(::))(?!.*\3.+\3))\3?|([\dA-F]{1,4}(\3|:\b|$)|\2))(?4){5}((?4){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i', trim( $maybe_ip, ' []' ) ) )
Index: tests/phpunit/tests/http/http.php
===================================================================
--- tests/phpunit/tests/http/http.php	(revision 35580)
+++ tests/phpunit/tests/http/http.php	(working copy)
@@ -102,4 +102,87 @@
 		  - ://example.com - assumed path in PHP >= 5.4.7, fails in <5.4.7
 		*/
 	}
+
+	/**
+	 * @dataProvider ip_address_testcases
+	 */
+	function test_is_ip_address( $maybe_ip, $expected ) {
+		$actual = WP_Http::is_ip_address( $maybe_ip );
+		$this->assertEquals( $expected, $actual );
+	}
+
+	function ip_address_testcases() {
+		// 0: The IP Address, 1: The expected resulting
+		return array(
+			// Valid IPv4 address
+			// See: http://tools.ietf.org/html/rfc5737
+			array( '0.0.0.0', 4 ),
+			array( '127.0.0.1', 4 ), // The loopback address
+			array( '192.0.2.0', 4 ), // RFC 5737 - IPv4 Address Blocks Reserved for Documentation
+			array( '198.51.100.0', 4 ), // RFC 5737 - IPv4 Address Blocks Reserved for Documentation
+			array( '203.0.113.0', 4 ), // RFC 5737 - IPv4 Address Blocks Reserved for Documentation
+			array( '255.255.255.255', 4 ),
+			
+			// Invalid IPv4 address
+			array( '256.255.255.255', false ), // The first octet is out of range
+			array( '255.256.255.255', false ), // The second octet is out of range
+			array( '255.255.256.255', false ), // The third octet is out of range
+			array( '255.255.255.256', false ), // The fourth octet is out of range
+			array( '999.999.999.999', false ), // All octet is out of range
+			array( '2000.1.1.1', false ),
+			array( '1.2000.1.1', false ),
+			array( '1.1.2000.1', false ),
+			array( '1.1.1.2000', false ),
+			array( '2000.2000.2000.2000', false ),
+			
+			// Valid IPv6 address
+			// See: http://tools.ietf.org/html/rfc4291
+			array( '0:0:0:0:0:0:0:0', 6 ), // The unspecified address
+			array( '::', 6 ), // The unspecified address (in compressed form)
+			array( '0:0:0:0:0:0:0:1', 6 ), // The loopback address
+			array( '::1', 6 ), // The loopback address (in compressed form)
+			array( '2001:db8::', 6 ), // RFC 3849 - IPv6 Address Prefix Reserved for Documentation
+			array( '2001:0db8:0000:0000:0000:0000:dead:beaf', 6 ),
+			array( '2001:db8:0:0:0:0:dead:beaf', 6 ),
+			array( '2001:db8::dead:beaf', 6 ),
+			array( 'ABCD:EF01:2345:6789:ABCD:EF01:2345:6789', 6 ), // RFC 4291 - Example
+			array( '2001:DB8:0:0:8:800:200C:417A', 6 ), // RFC 4291 - Example of unicast address
+			array( '2001:DB8::8:800:200C:417A', 6 ), // RFC 4291 - Example of unicast address (in compressed form)
+			array( 'FF01:0:0:0:0:0:0:101', 6 ), // RFC 4291 - Example of multicast address
+			array( 'FF01::101', 6 ), // RFC 4291 - Example of multicast address (in compressed form)
+			array( '0:0:0:0:0:0:13.1.68.3', 6 ), // RFC 4291 - Example of an alternative form with a mixed environment of IPv4 and IPv6 nodes
+			array( '::13.1.68.3', 6 ), // RFC 4291 - Example of an alternative form with a mixed environment of IPv4 and IPv6 nodes (in compressed form)
+			array( '0:0:0:0:0:FFFF:129.144.52.38', 6 ), // RFC 4291 - Example of an alternative form with a mixed environment of IPv4 and IPv6 nodes
+			array( '::FFFF:129.144.52.38', 6 ), // RFC 4291 - Example of an alternative form with a mixed environment of IPv4 and IPv6 nodes (in compressed form)
+			
+			// Invalid IPv6 address
+			// See: https://github.com/richb-intermapper/IPv6-Regex
+			array( '2001:DB8:0:0:8:800:200C:417A:221', false ), // unicast full
+			array( 'FF01::101::2', false ), // multicast compressed
+			array( '02001:0000:1234:0000:0000:C1C0:ABCD:0876', false ), // extra 0 not allowed
+			array( '2001:0000:1234:0000:00001:C1C0:ABCD:0876', false ), // extra 0 not allowed
+			array( '2001:0000:1234:0000:0000:C1C0:ABCD:0876  0', false ), // junk after valid address
+			array( '2001:0000:1234: 0000:0000:C1C0:ABCD:0876', false ), // internal space
+			array( '3ffe:0b00:0000:0001:0000:0000:000a', false ), // Segments is less than 8
+			array( 'FF02:0000:0000:0000:0000:0000:0000:0000:0001', false ), // Segments is over 8
+			array( '3ffe:b00::1::a', false ), // Compressed double
+			array( '::1111:2222:3333:4444:5555:6666::', false ), // Compressed double
+			array( '1::5:400.2.3.4', false ), // Embedded ipv4 address is out of range
+			array( '1::5:192.168.0.256', false ), // Embedded ipv4 address is out of range
+			array( '2001:1:1:1:1:1:255Z255X255Y255', false ), // garbage instead of "." in IPv4
+			array( '::ffff:192x168.1.26', false ), // ditto
+			array( '::ffff:2.3.4', false ), // has ipv4 octet lost
+			array( '1.2.3.4:1111:2222:3333:4444::5555', false ), // Aeron
+			array( ':', false ),
+			array( ':::', false ),
+			
+			// other
+			array( '123', false ),
+			array( 'ldkfj', false ),
+			array( '.', false ),
+			array( '..', false ),
+			array( '...', false ),
+			
+		);
+	}
 }
