Changeset 61713
- Timestamp:
- 02/21/2026 04:40:18 AM (8 weeks ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
src/wp-includes/IXR/class-IXR-client.php (modified) (1 diff)
-
src/wp-includes/class-wp-http-ixr-client.php (modified) (1 diff)
-
tests/phpunit/tests/xmlrpc/client.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/IXR/class-IXR-client.php
r61457 r61713 31 31 // Assume we have been given a URL instead 32 32 $bits = parse_url($server); 33 $this->server = $bits['host'] ;33 $this->server = $bits['host'] ?? ''; 34 34 $this->port = $bits['port'] ?? 80; 35 35 $this->path = $bits['path'] ?? '/'; -
trunk/src/wp-includes/class-wp-http-ixr-client.php
r61594 r61713 24 24 // Assume we have been given a URL instead. 25 25 $bits = parse_url( $server ); 26 $this->scheme = $bits['scheme'] ;27 $this->server = $bits['host'] ;26 $this->scheme = $bits['scheme'] ?? ''; 27 $this->server = $bits['host'] ?? ''; 28 28 $this->port = $bits['port'] ?? $port; 29 $this->path = ! empty( $bits['path'] ) ? $bits['path'] :'/';29 $this->path = $bits['path'] ?? '/'; 30 30 31 31 // Make absolutely sure we have a path. -
trunk/tests/phpunit/tests/xmlrpc/client.php
r56536 r61713 19 19 20 20 /** 21 * @ticket 64635 22 */ 23 public function test_ixr_client_can_handle_missing_host() { 24 $client = new IXR_Client( '/no-host-here' ); 25 $this->assertSame( '', $client->server ); 26 } 27 28 /** 21 29 * @ticket 26947 22 30 */ … … 27 35 $this->assertSame( '/server.php?this-is-needed=true', $client->path ); 28 36 } 37 38 /** 39 * @ticket 40784 40 */ 41 public function test_wp_ixr_client_can_handle_protocolless_urls() { 42 $client = new WP_HTTP_IXR_Client( '//example.com/server.php' ); 43 $this->assertSame( '', $client->scheme ); 44 $this->assertSame( 'example.com', $client->server ); 45 } 46 47 /** 48 * @ticket 40784 49 */ 50 public function test_wp_ixr_client_can_handle_relative_urls() { 51 $client = new WP_HTTP_IXR_Client( '/server.php' ); 52 $this->assertSame( '', $client->scheme ); 53 $this->assertSame( '', $client->server ); 54 $this->assertSame( '/server.php', $client->path ); 55 } 56 57 /** 58 * @ticket 40784 59 */ 60 public function test_wp_ixr_client_can_handle_invalid_urls() { 61 $client = new WP_HTTP_IXR_Client( '' ); 62 $this->assertSame( '', $client->scheme ); 63 $this->assertSame( '', $client->server ); 64 $this->assertSame( '/', $client->path ); 65 } 29 66 }
Note: See TracChangeset
for help on using the changeset viewer.