[wp-trac] [WordPress Trac] #44210: Add filter for developers testing downloads from local servers

WordPress Trac noreply at wordpress.org
Thu May 24 02:26:00 UTC 2018


#44210: Add filter for developers testing downloads from local servers
-------------------------+------------------------------------
 Reporter:  afragen      |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  HTTP API     |    Version:  trunk
 Severity:  normal       |   Keywords:  has-patch dev-feedback
  Focuses:               |
-------------------------+------------------------------------
 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44210>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list