Opened 11 years ago

Closed 6 years ago

#1822 closed defect (wontfix)

spaces in username not escaped when using $U

Reported by: robspassky Owned by: John Hampton
Priority: normal Component: TracBlogPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10


I'm setting a trac where each user can have their own blog, so I use the $U in the blog page name. But I also have users with spaces in their names, and they were ending making invalid pages.

I fixed it by putting the following into

"from urllib import quote"

and around line 140 (right before "if req.method == 'POST'"), I put:

"pagename = quote(pagename)"

That seemed to resolve it.

This is for 0.10.

Attachments (0)

Change History (3)

comment:1 Changed 11 years ago by robspassky

I'm sorry, that fix didn't work. I mean, the page is found, but the URL is messed up:


I'll look at it and try again.

comment:2 Changed 11 years ago by robspassky

I tried to do the quoting further upstream, in the base trac code for wiki links. And also in the TracBlog ClearSilver template blog.cs. Both times the url got badly garbled with a "href%...%...not found..." something or other.

I'm afraid I don't know enough about Trac's rendering process to fix it properly.

So, since I have to move on, I just stripped out the spaces:

pagename = re.sub(r' ', , pagename)

This is in, right before the "if req.method == 'POST':"

comment:3 Changed 6 years ago by Ryan J Ollos

Resolution: wontfix
Status: newclosed

TracBlogPlugin is only for 0.10, as noted on the wiki page. Trac 0.10 is dead now. For blog support, see FullBlogPlugin, which works for Trac 0.11 and later.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain John Hampton.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.