Make WordPress Core

Opened 10 years ago

Closed 6 years ago

#27364 closed defect (bug) (duplicate)

Attachments cannot be imported if hosted locally

Reported by: markjaquith's profile markjaquith Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Import Keywords: needs-patch
Focuses: Cc:


If you're doing a WordPress import and you're importing attachments and the attachments are hosted locally, their import fails with "Remote server did not respond". Chased this down the rabbit hole, and it's because of reject_unsafe_urls.

See also: #24646

Change History (5)

#2 @markjaquith
10 years ago

I'd be less frustrated here if the error message were more specific than "Remote server did not respond." We have a good error message, but we bail with false and lose all that data, and thus the importer doesn't really know what happened.

#3 @jesin
10 years ago

The check for external URLs when hosted locally happens in the wp_http_validate_url() function.

This function also returns false for the following reasons

So this function has to be modified to handle errors with WP_Error.

This function applies the filter http_request_host_is_external when doing the external URL on a local setup check which can be set to true in the importer plugin to import external attachments.

#4 @chriscct7
8 years ago

  • Keywords needs-patch added

#5 @ocean90
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #26247.

Note: See TracTickets for help on using tickets.