Opened 13 years ago
Closed 13 years ago
#22666 closed defect (bug) (fixed)
When evaluating path in get_*_url(), '..' can match the query string
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 3.6 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Permalinks | Keywords: | has-patch |
| Focuses: | Cc: |
Description
http://nacins-beard.com/gallery/?s=... is a valid URL. A common way to generate it and URLs like it is:
home_url( '/gallery/?s=..' )
This will return:
http://nacins-beard.com
Why? Because most of the get_*_url functions check for .. on the entire URI, not limited to the path. My patch fixes this and uses a function that all of the url functions share, eliminating a bunch of dupe'd code.
Attachments (1)
Change History (8)
#2
@
13 years ago
- Milestone changed from Awaiting Review to 3.6
join_with_slashes never made it into 3.5 - add_path_to_url works generically with any URL that already has a path or not and the passed path. The main point of it: it condenses code that is repeated all over the place (10 other functions!), and join_with_slashes does not.
Note: See
TracTickets for help on using
tickets.
add_to_path() sounds a bit like join_with_slashes(), see #19796 for patches.