[wp-trac] [WordPress Trac] #27364: Attachments cannot be imported if hosted locally
WordPress Trac
noreply at wordpress.org
Sat Apr 5 11:26:06 UTC 2014
#27364: Attachments cannot be imported if hosted locally
--------------------------+------------------------------
Reporter: markjaquith | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Import | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by jesin):
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
* URL is not of scheme http or https
* If the URL contains a HTTP username or password in it (eg.
http://user:pass@example.com/)
* URL is external and has a port number which is not 80, 443 or 8080
* URL is same as home URL but its port number neither matches the previous
condition nor the home URL's port (eg. home URL - http://example.com:9000
and requested URL is http://example.com:9001)
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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27364#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list