#2496 closed defect (bug) (fixed)
Support slashes in slug settings
Reported by: | mordauk | Owned by: | |
---|---|---|---|
Milestone: | 2.5.4 | Priority: | highest omg sweet tea |
Severity: | normal | Version: | 2.1 |
Component: | API - Rewrite Rules | Keywords: | |
Cc: | pippin@… |
Description
Scenario: a site needs to have forum user profiles set to forums/membership-services/view-profile/{username}
Problem: in order to do this (without modifying the URLs via a filter) the user needs to set User Base
slug to membership-services/view-profile
, except bbPress strips slashes from these fields.
It'd be great to be able to set bbPress URLs that contain an extra level.
Attachments (1)
Change History (10)
#3
@
11 years ago
sanitize_text_field()
does not strip enough out. It allows unsafe URL characters, causing 404's.
We need a function that explode()
's by /
and calls a number of sanitization's on each chunk in the string.
Currently the slugs are all passed through
sanitize_title()
for thesanitize_callback
. We can support slashes by passing it throughsanitize_text_field()
instead.I've tested this and it does work by simply changing
sanitize_title()
tosanitize_text_field()
. Are there any draw backs to doing this?