Make WordPress Core

Opened 8 months ago

Closed 5 months ago

Last modified 5 months ago

#60565 closed enhancement (fixed)

download_url() returns inaccurate error message on missing URL argument

Reported by: hinnerk's profile hinnerk Owned by: audrasjb's profile audrasjb
Milestone: 6.6 Priority: normal
Severity: trivial Version: 6.4.3
Component: HTTP API Keywords: has-patch commit has-unit-tests
Focuses: Cc:

Description

Expected:

<?php
if ( ! $url ) {
    return new WP_Error( 'http_no_url', __( 'No URL Provided.' ) );
}

Current implementation:

<?php
if ( ! $url ) {
    return new WP_Error( 'http_no_url', __( 'Invalid URL Provided.' ) );
}

see
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/file.php#L1158

Change History (8)

#1 @audrasjb
8 months ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 6.6
  • Owner set to audrasjb
  • Status changed from new to reviewing

Thanks for the ticket and patch,
Self assigning for review.

#2 @oglekler
5 months ago

@audrasjb can you proceed with this one? I don't see an actual patch, but it looks quite reasonable, still this is a string change that need to be done.

This ticket was mentioned in PR #6571 on WordPress/wordpress-develop by hinnerk-a.


5 months ago
#3

This ticket was mentioned in PR #6647 on WordPress/wordpress-develop by @audrasjb.


5 months ago
#4

#5 @audrasjb
5 months ago

  • Keywords commit has-unit-tests added

The above PR also updates the related unit tests.
Marking for commit.

@audrasjb commented on PR #6571:


5 months ago
#6

Closing in favor of https://github.com/WordPress/wordpress-develop/pull/6647 which updates the related unit tests.

#7 @audrasjb
5 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 58208:

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.

Note: See TracTickets for help on using tickets.