Ticket #2149 (closed defect: fixed)
Opened 6 years ago
Last modified 6 years ago
Redirecting wiki page which ends with '/'
| Reported by: | Shunichi Goto <gotoh@…> | Owned by: | cboos |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.10 |
| Component: | wiki system | Version: | devel |
| Severity: | minor | Keywords: | review |
| Cc: | |||
| Release Notes: | |||
| API Changes: | |||
Description
If I request to wiki page url with slash at the end of url (i.e. .../wiki/StartPage/),
trac says "Describe "Start/" here" althou 'StartPage?' is exist.
To allow structured wiki pages, I think it is better that trac treat
".../wiki/StartPage/" page as ".../wiki/Startpage".
Here's a sample patch by using redirection:
-
web_ui.py
71 71 action = req.args.get('action', 'view') 72 72 pagename = req.args.get('page', 'WikiStart') 73 73 version = req.args.get('version') 74 if 1 < len(pagename) and pagename.endswith('/'): 75 req.redirect(self.env.href.wiki(pagename[:-1])) 74 76 75 77 db = self.env.get_db_cnx()
Attachments
Change History
comment:1 Changed 6 years ago by Shunichi Goto <gotoh@…>
comment:2 Changed 6 years ago by cboos
- Owner changed from jonas to cboos
- Severity changed from normal to minor
I think it's a good idea.
However, it might be surprising, as it's an exception
to the normal rule for explicit wiki page links,
where the WikiPageNames syntax is ignored:
e.g. wiki:About/? would here link to the About wiki page,
instead of the expected "About/" page.
But as I think it would be troublesome to allow creating
a page with an ending "/", it's OK for me. Others?
comment:4 Changed 6 years ago by cmlenz
This is a good idea in my opinion. I'd drop the 1 < len(pagename) part from the condition, which isn't needed AFAICT.
comment:5 Changed 6 years ago by cboos
- Resolution set to fixed
- Status changed from new to closed
Implemented in r2635.
comment:6 Changed 6 years ago by cboos
- Milestone set to 1.0
comment:7 Changed 6 years ago by cmlenz
- Milestone changed from 1.0 to 0.10



s/structured/hierarchical/