Modify

Opened 7 years ago

Closed 18 months ago

#1822 closed defect (wontfix)

spaces in username not escaped when using $U

Reported by: robspassky Owned by: pacopablo
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 7 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 7 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 18 months ago by rjollos

  • Resolution set to wontfix
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from pacopablo. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.