<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[16871] trunk/wp-includes/class-wp-http-ixr-client.php:
  Coding Standards clean-up, Variable typo fix ($errstr),
  Svn property correction.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16871">16871</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-12-11 05:51:49 +0000 (Sat, 11 Dec 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Coding Standards clean-up, Variable typo fix ($errstr), Svn property correction. See <a href="http://trac.wordpress.org/ticket/10588">#10588</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesclasswphttpixrclientphp">trunk/wp-includes/class-wp-http-ixr-client.php</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#trunkwpincludesclasswphttpixrclientphp">trunk/wp-includes/class-wp-http-ixr-client.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesclasswphttpixrclientphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/class-wp-http-ixr-client.php (16870 => 16871)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/class-wp-http-ixr-client.php        2010-12-11 04:59:49 UTC (rev 16870)
+++ trunk/wp-includes/class-wp-http-ixr-client.php        2010-12-11 05:51:49 UTC (rev 16871)
</span><span class="lines">@@ -6,92 +6,86 @@
</span><span class="cx">  * @since 3.1.0
</span><span class="cx">  *
</span><span class="cx">  */
</span><del>-class WP_HTTP_IXR_Client extends IXR_Client
-{
-    function WP_HTTP_IXR_Client($server, $path = false, $port = 80, $timeout = 15)
-    {
-        if (!$path) {
-            // Assume we have been given a URL instead
-            $bits = parse_url($server);
-            $this-&gt;scheme = $bits['scheme'];
-            $this-&gt;server = $bits['host'];
-            $this-&gt;port = isset($bits['port']) ? $bits['port'] : 80;
-            $this-&gt;path = isset($bits['path']) ? $bits['path'] : '/';
</del><ins>+class WP_HTTP_IXR_Client extends IXR_Client {
+        function WP_HTTP_IXR_Client($server, $path = false, $port = 80, $timeout = 15) {
+                if ( ! $path ) {
+                        // Assume we have been given a URL instead
+                        $bits = parse_url($server);
+                        $this-&gt;scheme = $bits['scheme'];
+                        $this-&gt;server = $bits['host'];
+                        $this-&gt;port = isset($bits['port']) ? $bits['port'] : 80;
+                        $this-&gt;path = !empty($bits['path']) ? $bits['path'] : '/';
</ins><span class="cx"> 
</span><del>-            // Make absolutely sure we have a path
-            if (!$this-&gt;path) {
-                $this-&gt;path = '/';
-            }
-        } else {
-                $this-&gt;scheme = 'http';
-            $this-&gt;server = $server;
-            $this-&gt;path = $path;
-            $this-&gt;port = $port;
-        }
-        $this-&gt;useragent = 'The Incutio XML-RPC PHP Library';
-        $this-&gt;timeout = $timeout;
-    }
</del><ins>+                        // Make absolutely sure we have a path
+                        if ( ! $this-&gt;path )
+                                $this-&gt;path = '/';
+                } else {
+                        $this-&gt;scheme = 'http';
+                        $this-&gt;server = $server;
+                        $this-&gt;path = $path;
+                        $this-&gt;port = $port;
+                }
+                $this-&gt;useragent = 'The Incutio XML-RPC PHP Library';
+                $this-&gt;timeout = $timeout;
+        }
</ins><span class="cx"> 
</span><del>-    function query()
-    {
-        $args = func_get_args();
-        $method = array_shift($args);
-        $request = new IXR_Request($method, $args);
-        $xml = $request-&gt;getXml();
</del><ins>+        function query() {
+                $args = func_get_args();
+                $method = array_shift($args);
+                $request = new IXR_Request($method, $args);
+                $xml = $request-&gt;getXml();
</ins><span class="cx"> 
</span><del>-        $url = $this-&gt;scheme . '://' . $this-&gt;server . ':' . $this-&gt;port . $this-&gt;path;
-        $args = array(
-            'headers'    =&gt; array('Content-Type' =&gt; 'text/xml'),
-            'user-agent' =&gt; $this-&gt;useragent,
-            'body'       =&gt; $xml,
-        );
</del><ins>+                $url = $this-&gt;scheme . '://' . $this-&gt;server . ':' . $this-&gt;port . $this-&gt;path;
+                $args = array(
+                        'headers'    =&gt; array('Content-Type' =&gt; 'text/xml'),
+                        'user-agent' =&gt; $this-&gt;useragent,
+                        'body'       =&gt; $xml,
+                );
</ins><span class="cx"> 
</span><del>-        // Merge Custom headers ala #8145
</del><ins>+                // Merge Custom headers ala #8145
</ins><span class="cx">                 foreach ( $this-&gt;headers as $header =&gt; $value )
</span><span class="cx">                         $args['headers'][$header] = $value;
</span><span class="cx"> 
</span><span class="cx">                 if ( $this-&gt;timeout !== false )
</span><span class="cx">                         $args['timeout'] = $this-&gt;timeout;
</span><span class="cx"> 
</span><del>-        // Now send the request
-        if ($this-&gt;debug) {
-            echo '&lt;pre class=&quot;ixr_request&quot;&gt;'.htmlspecialchars($xml).&quot;\n&lt;/pre&gt;\n\n&quot;;
-        }
</del><ins>+                // Now send the request
+                if ( $this-&gt;debug )
+                        echo '&lt;pre class=&quot;ixr_request&quot;&gt;' . htmlspecialchars($xml) . &quot;\n&lt;/pre&gt;\n\n&quot;;
</ins><span class="cx"> 
</span><span class="cx">                 $response = wp_remote_post($url, $args);
</span><span class="cx"> 
</span><span class="cx">                 if ( is_wp_error($response) ) {
</span><span class="cx">                         $errno    = $response-&gt;get_error_code();
</span><span class="cx">                         $errorstr = $response-&gt;get_error_message();
</span><del>-                        $this-&gt;error = new IXR_Error(-32300, &quot;transport error: $errno $errstr&quot;);
</del><ins>+                        $this-&gt;error = new IXR_Error(-32300, &quot;transport error: $errno $errorstr&quot;);
</ins><span class="cx">                         return false;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                $code = $response['response']['code'];
-                if ( $code != 200 ) {
-                        $this-&gt;error = new IXR_Error(-32301, &quot;transport error - HTTP status code was not 200 ($code)&quot;);             return false;
-        }
</del><ins>+                if ( $response['response']['code'] != 200 ) {
+                        $this-&gt;error = new IXR_Error(-32301, &quot;transport error - HTTP status code was not 200 ({$response['response']['code']})&quot;);
+                        return false;
+                }
</ins><span class="cx"> 
</span><del>-        if ($this-&gt;debug) {
-            echo '&lt;pre class=&quot;ixr_response&quot;&gt;'.htmlspecialchars($response['body']).&quot;\n&lt;/pre&gt;\n\n&quot;;
-        }
</del><ins>+                if ( $this-&gt;debug )
+                        echo '&lt;pre class=&quot;ixr_response&quot;&gt;' . htmlspecialchars($response['body']) . &quot;\n&lt;/pre&gt;\n\n&quot;;
</ins><span class="cx"> 
</span><del>-        // Now parse what we've got back
-        $this-&gt;message = new IXR_Message( $response['body'] );
-        if (!$this-&gt;message-&gt;parse()) {
-            // XML error
-            $this-&gt;error = new IXR_Error(-32700, 'parse error. not well formed');
-            return false;
-        }
</del><ins>+                // Now parse what we've got back
+                $this-&gt;message = new IXR_Message( $response['body'] );
+                if ( ! $this-&gt;message-&gt;parse() ) {
+                        // XML error
+                        $this-&gt;error = new IXR_Error(-32700, 'parse error. not well formed');
+                        return false;
+                }
</ins><span class="cx"> 
</span><del>-        // Is the message a fault?
-        if ($this-&gt;message-&gt;messageType == 'fault') {
-            $this-&gt;error = new IXR_Error($this-&gt;message-&gt;faultCode, $this-&gt;message-&gt;faultString);
-            return false;
-        }
</del><ins>+                // Is the message a fault?
+                if ( $this-&gt;message-&gt;messageType == 'fault' ) {
+                        $this-&gt;error = new IXR_Error($this-&gt;message-&gt;faultCode, $this-&gt;message-&gt;faultString);
+                        return false;
+                }
</ins><span class="cx"> 
</span><del>-        // Message must be OK
-        return true;
-    }
</del><ins>+                // Message must be OK
+                return true;
+        }
</ins><span class="cx"> }
</span><span class="cx"> ?&gt;
</span><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-includes/class-wp-http-ixr-client.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre>
</div>
</div>

</body>
</html>