Opened 11 years ago
Closed 11 years ago
#27684 closed defect (bug) (fixed)
wp_http_validate_url() - PHP Notice: undefined index port
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.5.1 |
Component: | HTTP API | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
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)
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Check if index
port
is set before comparing