Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

Last modified 3 years ago

#2149 closed defect (fixed)

Redirecting wiki page which ends with '/'

Reported by: Shunichi Goto <gotoh@…> Owned by: Christian Boos
Priority: normal Milestone: 0.10
Component: wiki system Version: devel
Severity: minor Keywords: review
Cc: Branch:
Release Notes:
API Changes:
Internal 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

     
    7171        action = req.args.get('action', 'view')
    7272        pagename = req.args.get('page', 'WikiStart')
    7373        version = req.args.get('version')
     74        if 1 < len(pagename) and pagename.endswith('/'):
     75            req.redirect(self.env.href.wiki(pagename[:-1]))
    7476
    7577        db = self.env.get_db_cnx()

Attachments (0)

Change History (7)

comment:1 by Shunichi Goto <gotoh@…>, 19 years ago

s/structured/hierarchical/

comment:2 by Christian Boos, 19 years ago

Owner: changed from Jonas Borgström to Christian Boos
Severity: normalminor

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:3 by Christian Boos, 19 years ago

Keywords: review added

#2323 marked as duplicate.

comment:4 by Christopher Lenz, 19 years ago

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 by Christian Boos, 19 years ago

Resolution: fixed
Status: newclosed

Implemented in r2635.

comment:6 by Christian Boos, 19 years ago

Milestone: 1.0

comment:7 by Christopher Lenz, 19 years ago

Milestone: 1.00.10

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.