HTTP API: Improve download_url() error message.
This changeset improves the error message returned when no URL is provided, and updates the related unit tests accordingly. Props hinnerk, audrasjb. Fixes #60565. Built from https://develop.svn.wordpress.org/trunk@58208 git-svn-id: http://core.svn.wordpress.org/trunk@57671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1155,7 +1155,7 @@ function wp_handle_sideload( &$file, $overrides = false, $time = null ) {
|
||||
function download_url( $url, $timeout = 300, $signature_verification = false ) {
|
||||
// WARNING: The file is not automatically deleted, the script must delete or move the file.
|
||||
if ( ! $url ) {
|
||||
return new WP_Error( 'http_no_url', __( 'Invalid URL Provided.' ) );
|
||||
return new WP_Error( 'http_no_url', __( 'No URL Provided.' ) );
|
||||
}
|
||||
|
||||
$url_path = parse_url( $url, PHP_URL_PATH );
|
||||
|
||||
Reference in New Issue
Block a user