Opened 12 years ago
Closed 12 years ago
#27684 closed defect (bug) (fixed)
wp_http_validate_url() - PHP Notice: undefined index port
| Reported by: | jesin | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.9 |
| Component: | HTTP API | Version: | 3.5.1 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Check if index
portis set before comparing