Changeset 47122 for trunk/src/wp-includes/class-wp-http-ixr-client.php
- Timestamp:
- 01/29/2020 12:43:23 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-http-ixr-client.php
r42876 r47122 21 21 public function __construct( $server, $path = false, $port = false, $timeout = 15 ) { 22 22 if ( ! $path ) { 23 // Assume we have been given a URL instead 23 // Assume we have been given a URL instead. 24 24 $bits = parse_url( $server ); 25 25 $this->scheme = $bits['scheme']; … … 28 28 $this->path = ! empty( $bits['path'] ) ? $bits['path'] : '/'; 29 29 30 // Make absolutely sure we have a path 30 // Make absolutely sure we have a path. 31 31 if ( ! $this->path ) { 32 32 $this->path = '/'; … … 63 63 ); 64 64 65 // Merge Custom headers ala #8145 65 // Merge Custom headers ala #8145. 66 66 foreach ( $this->headers as $header => $value ) { 67 67 $args['headers'][ $header ] = $value; … … 81 81 } 82 82 83 // Now send the request 83 // Now send the request. 84 84 if ( $this->debug ) { 85 85 echo '<pre class="ixr_request">' . htmlspecialchars( $xml ) . "\n</pre>\n\n"; … … 104 104 } 105 105 106 // Now parse what we've got back 106 // Now parse what we've got back. 107 107 $this->message = new IXR_Message( wp_remote_retrieve_body( $response ) ); 108 108 if ( ! $this->message->parse() ) { 109 // XML error 109 // XML error. 110 110 $this->error = new IXR_Error( -32700, 'parse error. not well formed' ); 111 111 return false; … … 118 118 } 119 119 120 // Message must be OK 120 // Message must be OK. 121 121 return true; 122 122 }
Note: See TracChangeset
for help on using the changeset viewer.