[wp-trac] [WordPress Trac] #27684: wp_http_validate_url() - PHP Notice: undefined index port

WordPress Trac noreply at wordpress.org
Sat Apr 5 12:15:33 UTC 2014


#27684: wp_http_validate_url() - PHP Notice: undefined index port
--------------------------+-----------------------------
 Reporter:  jesin         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  HTTP API      |    Version:  3.8.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 If the URL of my WordPress site is http://example.com/ and I pass the same
 URL with a port number which is NOT 80, 443 or 8080 to the
 `wp_http_validate_url()` function the following PHP notice is shown.

 {{{
 Notice:  Undefined index: port in /var/www/wp-includes/http.php on line
 513
 }}}

 Code to reproduce the problem.

 {{{
 var_dump ( wp_http_validate_url( 'http://yoursite.com:81' ) );
 }}}

 **Output:**
 {{{
 Notice:  Undefined index: port in /var/www/wp-includes/http.php on line
 513
 bool(false)
 }}}

 **Expected output:**
 {{{
 bool(false)
 }}}

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


More information about the wp-trac mailing list