Index: src/wp-includes/class-http.php
===================================================================
--- src/wp-includes/class-http.php	(revision 35471)
+++ src/wp-includes/class-http.php	(working copy)
@@ -140,7 +140,7 @@
 		$args = wp_parse_args( $args );
 
 		// By default, Head requests do not cause redirections.
-		if ( isset($args['method']) && 'HEAD' == $args['method'] )
+		if ( isset( $args['method'] ) && 'HEAD' == $args['method'] )
 			$defaults['redirection'] = 0;
 
 		$r = wp_parse_args( $args, $defaults );
@@ -192,7 +192,7 @@
 		$arrURL = @parse_url( $url );
 
 		if ( empty( $url ) || empty( $arrURL['scheme'] ) )
-			return new WP_Error('http_request_failed', __('A valid URL was not provided.'));
+			return new WP_Error( 'http_request_failed', __( 'A valid URL was not provided.' ) );
 
 		if ( $this->block_request( $url ) )
 			return new WP_Error( 'http_request_failed', __( 'User has blocked requests through HTTP.' ) );
@@ -406,10 +406,10 @@
 	 * @param string|array $args Optional. Override the defaults.
 	 * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
 	 */
-	public function post($url, $args = array()) {
-		$defaults = array('method' => 'POST');
+	public function post( $url, $args = array() ) {
+		$defaults = array( 'method' => 'POST' );
 		$r = wp_parse_args( $args, $defaults );
-		return $this->request($url, $r);
+		return $this->request( $url, $r );
 	}
 
 	/**
@@ -424,10 +424,10 @@
 	 * @param string|array $args Optional. Override the defaults.
 	 * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
 	 */
-	public function get($url, $args = array()) {
-		$defaults = array('method' => 'GET');
+	public function get( $url, $args = array() ) {
+		$defaults = array( 'method' => 'GET' );
 		$r = wp_parse_args( $args, $defaults );
-		return $this->request($url, $r);
+		return $this->request( $url, $r );
 	}
 
 	/**
@@ -442,10 +442,10 @@
 	 * @param string|array $args Optional. Override the defaults.
 	 * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
 	 */
-	public function head($url, $args = array()) {
-		$defaults = array('method' => 'HEAD');
+	public function head( $url, $args = array() ) {
+		$defaults = array( 'method' => 'HEAD' );
 		$r = wp_parse_args( $args, $defaults );
-		return $this->request($url, $r);
+		return $this->request( $url, $r );
 	}
 
 	/**
@@ -458,10 +458,10 @@
 	 * @param string $strResponse The full response string
 	 * @return array Array with 'headers' and 'body' keys.
 	 */
-	public static function processResponse($strResponse) {
-		$res = explode("\r\n\r\n", $strResponse, 2);
+	public static function processResponse( $strResponse ) {
+		$res = explode( "\r\n\r\n", $strResponse, 2 );
 
-		return array('headers' => $res[0], 'body' => isset($res[1]) ? $res[1] : '');
+		return array( 'headers' => $res[0], 'body' => isset($res[1] ) ? $res[1] : '');
 	}
 
 	/**
@@ -481,27 +481,27 @@
 	 */
 	public static function processHeaders( $headers, $url = '' ) {
 		// Split headers, one per array element.
-		if ( is_string($headers) ) {
+		if ( is_string( $headers ) ) {
 			// Tolerate line terminator: CRLF = LF (RFC 2616 19.3).
-			$headers = str_replace("\r\n", "\n", $headers);
+			$headers = str_replace( "\r\n", "\n", $headers );
 			/*
 			 * Unfold folded header fields. LWS = [CRLF] 1*( SP | HT ) <US-ASCII SP, space (32)>,
 			 * <US-ASCII HT, horizontal-tab (9)> (RFC 2616 2.2).
 			 */
-			$headers = preg_replace('/\n[ \t]/', ' ', $headers);
+			$headers = preg_replace( '/\n[ \t]/', ' ', $headers );
 			// Create the headers array.
-			$headers = explode("\n", $headers);
+			$headers = explode( "\n", $headers );
 		}
 
-		$response = array('code' => 0, 'message' => '');
+		$response = array( 'code' => 0, 'message' => '' );
 
 		/*
 		 * If a redirection has taken place, The headers for each page request may have been passed.
 		 * In this case, determine the final HTTP header and parse from there.
 		 */
-		for ( $i = count($headers)-1; $i >= 0; $i-- ) {
-			if ( !empty($headers[$i]) && false === strpos($headers[$i], ':') ) {
-				$headers = array_splice($headers, $i);
+		for ( $i = count( $headers )-1; $i >= 0; $i-- ) {
+			if ( !empty( $headers[$i] ) && false === strpos( $headers[$i], ':' ) ) {
+				$headers = array_splice( $headers, $i );
 				break;
 			}
 		}
@@ -509,17 +509,17 @@
 		$cookies = array();
 		$newheaders = array();
 		foreach ( (array) $headers as $tempheader ) {
-			if ( empty($tempheader) )
+			if ( empty( $tempheader ) )
 				continue;
 
-			if ( false === strpos($tempheader, ':') ) {
-				$stack = explode(' ', $tempheader, 3);
+			if ( false === strpos( $tempheader, ':' ) ) {
+				$stack = explode( ' ', $tempheader, 3 );
 				$stack[] = '';
-				list( , $response['code'], $response['message']) = $stack;
+				list( , $response['code'], $response['message'] ) = $stack;
 				continue;
 			}
 
-			list($key, $value) = explode(':', $tempheader, 2);
+			list($key, $value) = explode( ':', $tempheader, 2 );
 
 			$key = strtolower( $key );
 			$value = trim( $value );
@@ -555,7 +555,7 @@
 	 * @param array $r Full array of args passed into ::request()
 	 */
 	public static function buildCookieHeader( &$r ) {
-		if ( ! empty($r['cookies']) ) {
+		if ( ! empty( $r['cookies'] ) ) {
 			// Upgrade any name => value cookie pairs to WP_HTTP_Cookie instances.
 			foreach ( $r['cookies'] as $name => $value ) {
 				if ( ! is_object( $value ) )
@@ -638,12 +638,12 @@
 	 * @param string $uri URI of url.
 	 * @return bool True to block, false to allow.
 	 */
-	public function block_request($uri) {
+	public function block_request( $uri ) {
 		// We don't need to block requests, because nothing is blocked.
 		if ( ! defined( 'WP_HTTP_BLOCK_EXTERNAL' ) || ! WP_HTTP_BLOCK_EXTERNAL )
 			return false;
 
-		$check = parse_url($uri);
+		$check = parse_url( $uri );
 		if ( ! $check )
 			return true;
 
@@ -662,24 +662,24 @@
 			return apply_filters( 'block_local_requests', false );
 		}
 
-		if ( !defined('WP_ACCESSIBLE_HOSTS') )
+		if ( !defined( 'WP_ACCESSIBLE_HOSTS' ) )
 			return true;
 
 		static $accessible_hosts = null;
 		static $wildcard_regex = array();
 		if ( null === $accessible_hosts ) {
-			$accessible_hosts = preg_split('|,\s*|', WP_ACCESSIBLE_HOSTS);
+			$accessible_hosts = preg_split( '|,\s*|', WP_ACCESSIBLE_HOSTS );
 
-			if ( false !== strpos(WP_ACCESSIBLE_HOSTS, '*') ) {
+			if ( false !== strpos( WP_ACCESSIBLE_HOSTS, '*' ) ) {
 				$wildcard_regex = array();
 				foreach ( $accessible_hosts as $host )
 					$wildcard_regex[] = str_replace( '\*', '.+', preg_quote( $host, '/' ) );
-				$wildcard_regex = '/^(' . implode('|', $wildcard_regex) . ')$/i';
+				$wildcard_regex = '/^(' . implode( '|', $wildcard_regex ) . ')$/i';
 			}
 		}
 
-		if ( !empty($wildcard_regex) )
-			return !preg_match($wildcard_regex, $check['host']);
+		if ( !empty( $wildcard_regex ) )
+			return !preg_match( $wildcard_regex, $check['host'] );
 		else
 			return !in_array( $check['host'], $accessible_hosts ); //Inverse logic, If it's in the array, then we can't access it.
 
@@ -799,7 +799,7 @@
 
 		// Don't redirect if we've run out of redirects.
 		if ( $args['redirection']-- <= 0 )
-			return new WP_Error( 'http_request_failed', __('Too many redirects.') );
+			return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );
 
 		$redirect_location = $response['headers']['location'];
 
@@ -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, ' []' ) ) )
