Make WordPress Core

Changeset 58208


Ignore:
Timestamp:
05/27/2024 01:53:55 PM (7 months ago)
Author:
audrasjb
Message:

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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/file.php

    r58149 r58208  
    11561156    // WARNING: The file is not automatically deleted, the script must delete or move the file.
    11571157    if ( ! $url ) {
    1158         return new WP_Error( 'http_no_url', __( 'Invalid URL Provided.' ) );
     1158        return new WP_Error( 'http_no_url', __( 'No URL Provided.' ) );
    11591159    }
    11601160
  • trunk/tests/phpunit/tests/admin/includesFile.php

    r56559 r58208  
    295295        $this->assertWPError( $error );
    296296        $this->assertSame( 'http_no_url', $error->get_error_code() );
    297         $this->assertSame( 'Invalid URL Provided.', $error->get_error_message() );
     297        $this->assertSame( 'No URL Provided.', $error->get_error_message() );
    298298    }
    299299
Note: See TracChangeset for help on using the changeset viewer.