--- class-http.php	2010-07-03 23:22:56.144531200 +0300
+++ new.php	2010-07-03 23:39:39.615234300 +0300
@@ -240,7 +240,7 @@
 
 		$arrURL = parse_url( $url );
 
-		if ( empty( $url ) || empty( $arrURL['scheme'] ) )
+		if ( $url == "" || ! isset( $arrURL['scheme'] ) )
 			return new WP_Error('http_request_failed', __('A valid URL was not provided.'));
 
 		if ( $this->block_request( $url ) )
@@ -279,7 +279,7 @@
 		if ( WP_Http_Encoding::is_available() )
 			$r['headers']['Accept-Encoding'] = WP_Http_Encoding::accept_encoding();
 
-		if ( empty($r['body']) ) {
+		if ( $r['body'] == "" ) {
 			// Some servers fail when sending content without the content-length header being set.
 			// Also, to fix another bug, we only send when doing POST and PUT and the content-length
 			// header isn't already set.
@@ -425,7 +425,7 @@
 		// 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], ':') ) {
+			if ( $headers[$i] != "" && false === strpos($headers[$i], ':') ) {
 				$headers = array_splice($headers, $i);
 				break;
 			}
@@ -434,7 +434,7 @@
 		$cookies = array();
 		$newheaders = array();
 		foreach ( $headers as $tempheader ) {
-			if ( empty($tempheader) )
+			if ( $tempheader == "" )
 				continue;
 
 			if ( false === strpos($tempheader, ':') ) {
@@ -444,7 +444,7 @@
 
 			list($key, $value) = explode(':', $tempheader, 2);
 
-			if ( !empty( $value ) ) {
+			if ( $value != "" ) {
 				$key = strtolower( $key );
 				if ( isset( $newheaders[$key] ) ) {
 					if ( !is_array($newheaders[$key]) )
@@ -512,10 +512,10 @@
 			$hasChunk = (bool) preg_match( '/^([0-9a-f]+)(\s|\n)+/mi', $body, $match );
 
 			if ( $hasChunk ) {
-				if ( empty( $match[1] ) )
+				$length = hexdec( $match[1] );
+				if ( $length == 0 )
 					return $body;
 
-				$length = hexdec( $match[1] );
 				$chunkLength = strlen( $match[0] );
 
 				$strBody = substr($body, $chunkLength, $length);
@@ -694,7 +694,7 @@
 		else
 			$requestPath = $arrURL['path'] . ( isset($arrURL['query']) ? '?' . $arrURL['query'] : '' );
 
-		if ( empty($requestPath) )
+		if ( $requestPath == "" )
 			$requestPath .= '/';
 
 		$strHeaders = strtoupper($r['method']) . ' ' . $requestPath . ' HTTP/' . $r['httpversion'] . "\r\n";
@@ -755,7 +755,7 @@
 		}
 
 		// If the body was chunk encoded, then decode it.
-		if ( ! empty( $process['body'] ) && isset( $arrHeaders['headers']['transfer-encoding'] ) && 'chunked' == $arrHeaders['headers']['transfer-encoding'] )
+		if ( $process['body'] != "" && isset( $arrHeaders['headers']['transfer-encoding'] ) && 'chunked' == $arrHeaders['headers']['transfer-encoding'] )
 			$process['body'] = WP_Http::chunkTransferDecode($process['body']);
 
 		if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($arrHeaders['headers']) )
@@ -894,7 +894,7 @@
 
 		$processedHeaders = WP_Http::processHeaders($theHeaders);
 
-		if ( ! empty( $strResponse ) && isset( $processedHeaders['headers']['transfer-encoding'] ) && 'chunked' == $processedHeaders['headers']['transfer-encoding'] )
+		if ( $strResponse != "" && isset( $processedHeaders['headers']['transfer-encoding'] ) && 'chunked' == $processedHeaders['headers']['transfer-encoding'] )
 			$strResponse = WP_Http::chunkTransferDecode($strResponse);
 
 		if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($processedHeaders['headers']) )
@@ -1034,7 +1034,7 @@
 		if ( 'HEAD' == $r['method'] ) // Disable redirects for HEAD requests
 			$arrContext['http']['max_redirects'] = 1;
 
-		if ( ! empty($r['body'] ) )
+		if ( $r['body'] != "" )
 			$arrContext['http']['content'] = $r['body'];
 
 		$context = stream_context_create($arrContext);
@@ -1068,7 +1068,7 @@
 		else
 			$processedHeaders = WP_Http::processHeaders($meta['wrapper_data']);
 
-		if ( ! empty( $strResponse ) && isset( $processedHeaders['headers']['transfer-encoding'] ) && 'chunked' == $processedHeaders['headers']['transfer-encoding'] )
+		if ( $strResponse != "" && isset( $processedHeaders['headers']['transfer-encoding'] ) && 'chunked' == $processedHeaders['headers']['transfer-encoding'] )
 			$strResponse = WP_Http::chunkTransferDecode($strResponse);
 
 		if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($processedHeaders['headers']) )
@@ -1219,7 +1219,7 @@
 
 		// Error may still be set, Response may return headers or partial document, and error
 		// contains a reason the request was aborted, eg, timeout expired or max-redirects reached.
-		if ( false === $strResponse || ! empty($info['error']) )
+		if ( false === $strResponse || $info['error'] != "" )
 			return new WP_Error('http_request_failed', $info['response_code'] . ': ' . $info['error']);
 
 		if ( ! $r['blocking'] )
@@ -1232,7 +1232,7 @@
 
 		$theHeaders = WP_Http::processHeaders($theHeaders);
 
-		if ( ! empty( $theBody ) && isset( $theHeaders['headers']['transfer-encoding'] ) && 'chunked' == $theHeaders['headers']['transfer-encoding'] ) {
+		if ( $theBody != "" && isset( $theHeaders['headers']['transfer-encoding'] ) && 'chunked' == $theHeaders['headers']['transfer-encoding'] ) {
 			if ( !WP_DEBUG )
 				$theBody = @http_chunked_decode($theBody);
 			else
@@ -1401,7 +1401,7 @@
 
 		$theResponse = curl_exec( $handle );
 
-		if ( !empty($theResponse) ) {
+		if ( $theResponse != "" ) {
 			$headerLength = curl_getinfo($handle, CURLINFO_HEADER_SIZE);
 			$theHeaders = trim( substr($theResponse, 0, $headerLength) );
 			if ( strlen($theResponse) > $headerLength )
@@ -1430,7 +1430,7 @@
 		curl_close( $handle );
 
 		// See #11305 - When running under safe mode, redirection is disabled above. Handle it manually.
-		if ( !empty($theHeaders['headers']['location']) && (ini_get('safe_mode') || ini_get('open_basedir')) ) {
+		if ( $theHeaders['headers']['location'] != "" && (ini_get('safe_mode') || ini_get('open_basedir')) ) {
 			if ( $r['redirection']-- > 0 ) {
 				return $this->request($theHeaders['headers']['location'], $r);
 			} else {
@@ -1735,7 +1735,7 @@
 			// Set everything else as a property
 			foreach ( $pairs as $pair ) {
 				$pair = rtrim($pair);
-				if ( empty($pair) ) //Handles the cookie ending in ; which results in a empty final pair
+				if ( $pair == "" ) //Handles the cookie ending in ; which results in a empty final pair
 					continue;
 
 				list( $key, $val ) = strpos( $pair, '=' ) ? explode( '=', $pair ) : array( $pair, '' );
@@ -1814,7 +1814,7 @@
 	 * @return string Header encoded cookie name and value.
 	 */
 	function getHeaderValue() {
-		if ( empty( $this->name ) || empty( $this->value ) )
+		if ( $this->name == "" || $this->value == "" )
 			return '';
 
 		return $this->name . '=' . urlencode( $this->value );
@@ -1876,7 +1876,7 @@
 	 */
 	function decompress( $compressed, $length = null ) {
 
-		if ( empty($compressed) )
+		if ( $compressed == "" )
 			return $compressed;
 
 		if ( false !== ( $decompressed = @gzinflate( $compressed ) ) )
@@ -1976,7 +1976,7 @@
 	 */
 	function should_decode($headers) {
 		if ( is_array( $headers ) ) {
-			if ( array_key_exists('content-encoding', $headers) && ! empty( $headers['content-encoding'] ) )
+			if ( array_key_exists('content-encoding', $headers) && $headers['content-encoding'] != "" )
 				return true;
 		} else if ( is_string( $headers ) ) {
 			return ( stripos($headers, 'content-encoding:') !== false );
