Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#44210 closed enhancement (invalid)

Add filter for developers testing downloads from local servers

Reported by: afragen's profile afragen Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.1
Component: HTTP API Keywords: has-patch close
Focuses: Cc:


I can be the only one.

I have set up a local git server that runs on my LAN, 192.168.x.x

I use it to test plugin/theme updating. Within wp-includes/http.php wp_http_validate_url() we can already use the filter hook http_request_host_is_external, however, at the end of the function is a conditional test that will still fail and not return the $url. This is because $same_host is false if the dev environment and the local git server aren't on the same host/IP.

if ( $parsed_home && $same_host && isset( $parsed_home['port'] ) && $parsed_home['port'] === $port {
		return $url;

My patch is a filter in a new conditional just after this penultimate conditional.

Attachments (1)

44210.diff (459 bytes) - added by afragen 6 years ago.

Download all attachments as: .zip

Change History (3)

6 years ago

#1 @afragen
6 years ago

  • Keywords close added; dev-feedback removed
  • Resolution set to invalid
  • Status changed from new to closed

I found another way around by filtering 'http_request_args'. Sorry I was premature.

#2 @netweb
6 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.