Modify

Opened 17 years ago

Closed 12 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

Description

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 new_blog.py:

"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 17 years ago by robspassky

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

"xxxx..../wiki/blog/Rob00000000000000000047passky/2007/07/18/19.26"

I'll look at it and try again.

comment:2 Changed 17 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 new_blog.py, right before the "if req.method == 'POST':"

comment:3 Changed 12 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
Action
as closed The owner will remain John Hampton.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.