Changeset 29850
- Timestamp:
- 10/08/2014 05:37:56 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-http.php
r29849 r29850 676 676 return $maybe_relative_path; 677 677 678 // Check for a scheme.679 if ( false !== strpos( $maybe_relative_path, '://' ) )680 return $maybe_relative_path;681 682 678 if ( ! $url_parts = @parse_url( $url ) ) 683 679 return $maybe_relative_path; … … 685 681 if ( ! $relative_url_parts = @parse_url( $maybe_relative_path ) ) 686 682 return $maybe_relative_path; 683 684 // Check for a scheme on the 'relative' url 685 if ( ! empty( $relative_url_parts['scheme'] ) ) { 686 return $maybe_relative_path; 687 } 687 688 688 689 $absolute_path = $url_parts['scheme'] . '://' . $url_parts['host']; -
trunk/tests/phpunit/tests/http/http.php
r25002 r29850 57 57 58 58 // A file with a leading dot 59 array( '.ext', 'http://example.com/', 'http://example.com/.ext' ) 59 array( '.ext', 'http://example.com/', 'http://example.com/.ext' ), 60 61 // URls within URLs 62 array( '/expected', 'http://example.com/sub/http://site.com/sub/', 'http://example.com/expected' ), 63 array( '/expected/http://site.com/sub/', 'http://example.com/', 'http://example.com/expected/http://site.com/sub/' ), 60 64 ); 61 65 }
Note: See TracChangeset
for help on using the changeset viewer.