[wp-trac] [WordPress Trac] #37991: fsockopen logic bug

WordPress Trac noreply at wordpress.org
Fri Sep 9 13:58:24 UTC 2016


#37991: fsockopen logic bug
--------------------------+------------------------------
 Reporter:  amandato      |       Owner:  dd32
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  HTTP API      |     Version:  4.6.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by amandato):

 Great!

 I did some testing for situations such as custom scheme, no scheme and
 custom ports with http and https and found my original patch had an error.
 I rewrote the patch using a switch case as it better handles the
 situations that can happen. Will upload patch here as well as on the
 github thread. (see my latest attachment)

 test cases:


 {{{
 http://example.com/ (Host: example.com)
 http://example.com:443/ (Host: example.com:443)
 http://example.com:123/ (Host: example.com:123)
 https://example.com/ (Host: example.com)
 https://example.com:80/ (Host: example.com:80)
 https://example.com:400/ (Host: example.com:400)
 foo://example.com/ (Host: example.com)
 foo://example.com:443/ (Host: example.com:443)
 foo://example.com:999/ (Host: example.com:999)
 //example.com/  (Host: example.com)
 //example.com:443/ (Host: example.com:443) - this one is up for comment if
 port should be specified if SSL is used. I believe the port should be
 specified, we cannot predict why a custom scheme would be using 443.
 //example.com:999/ (Host: example.com:999)
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37991#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list