Opened 7 years ago
Last modified 5 weeks ago
#46791 reopened defect (bug)
esc_url() adding http:// to a relative URL to parent directory '../pathname/'
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | 5.1 |
| Component: | Formatting | Keywords: | has-patch has-unit-tests |
| Focuses: | Cc: |
Description
esc_url() adds 'http://' when it shouldn't.
Line 4191 wp-includes/formatting.php states
If the URL doesn't appear to contain a scheme, we presume it needs http:// prepended (unless a relative link starting with /, # or ? or a php file).
This is prepending http:// to a relative url to a parent directory i.e. ../path-to-page/
Funtion needs ../ adding to the array or some regex code.
Attachments (2)
Change History (11)
#4
follow-up:
↓ 5
@
7 years ago
- Keywords has-patch added; needs-patch removed
@OrangePixelNath did you mean to close this ticket? If so, can you detail why? What did you discover that made your report incorrect or unnecessary?
#5
in reply to:
↑ 4
@
7 years ago
- Resolution worksforme deleted
- Status changed from closed to reopened
Replying to desrosj:
@OrangePixelNath did you mean to close this ticket? If so, can you detail why? What did you discover that made your report incorrect or unnecessary?
No sorry. I'm new to the system so didn't understand what was next.
#6
@
7 years ago
- Keywords needs-testing added
No problem! That’s why I checked to be sure :)
Next, the ticket stays open for community members to text and review.
#7
@
5 weeks ago
- Keywords needs-refresh added; needs-testing removed
The patch doesn't apply cleanly; it fails with the error:
Running "patch:46791" (patch) task ? Please select a patch to apply 46791-2.diff (782 bytes) - adde d by subrataemfluence 7 years ago. patching file wp-includes/formatting.php Hunk #1 FAILED at 4190. 1 out of 1 hunk FAILED -- saving rejects to file wp-includes/formatting.php.rej
Patch needs a refresh and removing needs-testing.
This ticket was mentioned in PR #10849 on WordPress/wordpress-develop by @sabernhardt.
5 weeks ago
#8
- Keywords has-unit-tests added; needs-refresh removed
Does not prepend the fallback protocol when the reference starts with a dot (./ or ../).
Proposed patch.