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:
audrasjb 2024-05-27 13:55:12 +00:00
parent fd798307a0
commit 9df0603c96
2 changed files with 2 additions and 2 deletions

View File

@ -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 );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-alpha-58207';
$wp_version = '6.6-alpha-58208';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.