IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
26 | 26 | $this->assertFalse( $client->port ); |
27 | 27 | $this->assertEquals( '/server.php?this-is-needed=true', $client->path ); |
28 | 28 | } |
| 29 | |
| 30 | /** |
| 31 | * @ticket 40784 |
| 32 | */ |
| 33 | function test_wp_ixr_client_can_handle_protocolless_urls() { |
| 34 | $client = new WP_HTTP_IXR_Client( '//example.com/server.php' ); |
| 35 | $this->assertEquals( '', $client->scheme ); |
| 36 | $this->assertEquals( 'example.com', $client->server ); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * @ticket 40784 |
| 41 | */ |
| 42 | function test_wp_ixr_client_can_handle_relative_urls() { |
| 43 | $client = new WP_HTTP_IXR_Client( '/server.php' ); |
| 44 | $this->assertEquals( '', $client->scheme ); |
| 45 | $this->assertEquals( '', $client->server ); |
| 46 | $this->assertEquals( '/server.php', $client->path ); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * @ticket 40784 |
| 51 | */ |
| 52 | function test_wp_ixr_client_can_handle_invalid_urls() { |
| 53 | $client = new WP_HTTP_IXR_Client( '' ); |
| 54 | $this->assertEquals( '', $client->scheme ); |
| 55 | $this->assertEquals( '', $client->server ); |
| 56 | $this->assertEquals( '', $client->path ); |
| 57 | } |
29 | 58 | } |
30 | 59 | |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
23 | 23 | if ( ! $path ) { |
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 = isset($bits['scheme']) ? $bits['scheme'] : ''; |
| 27 | $this->server = isset($bits['host']) ? $bits['host'] : ''; |
28 | 28 | $this->port = isset($bits['port']) ? $bits['port'] : $port; |
29 | 29 | $this->path = !empty($bits['path']) ? $bits['path'] : '/'; |
30 | 30 | |