Opened 9 years ago

Closed 8 years ago

Blog Post Unavailable if Name Consists of Slashes

Reported by: Owned by: pacopablo osimons normal FullBlogPlugin normal tracblog 0.11

Description

When creating a blog post, one can put slashes in the name field. For example:

pacopablo/blog/foobar


Is an accepted name for a post. When visiting the main Blog page, the post can be see fine. However, if you click on the post, or "Comments" or whatever, you get the following error:

Not a valid path for viewing blog posts.


While I understand most people don't bother using slashes in post names, it is an issue for #2927 as I suspect most TracBlogPlugin posts use some type of hierarchy in the wiki. If it is determined that slashes really should not be in blog post names, a check for slashes needs to be implemented when posting a new entry. In this case, I can just take the basename of the TracBlogPlugin posts. Or, if you want to have slashes be valid in blog post names, then I'll just move the name over directly.

comment:1 follow-up: ↓ 2 Changed 9 years ago by osimons

Where are we on this? Did we agree on IRC to disallow '/' in post names? Perhaps auto-replace/auto-suggest '_'?

comment:2 in reply to: ↑ 1 Changed 9 years ago by pacopablo

Where are we on this? Did we agree on IRC to disallow '/' in post names? Perhaps auto-replace/auto-suggest '_'?

Yeah, I think disallowing '/' is the right solution. The TracBlogPlugin migration script on #2927 simply replaces '/' with '_'.

comment:3 Changed 8 years ago by osimons

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

Well, as of [3906] this should be fixed - any sequence of characters should be OK as long as it doesn't directly conflict with the built-in 'command' usage for /category/something, /edit/the/post and similar.

It is likely as good as it is going to get when handling all kinds of requests inside the /blog/ namespace. Closing.

comment:4 Changed 8 years ago by khundeen

• Resolution fixed deleted
• Status changed from closed to reopened

There is a problem with this fix. I accidentally create blog name with "/". There was the error message but the blog entry was created. This is problem because I can't go in and remove that blog because I got the error message "Not a valid path for viewing blog posts." when I tried to do so.

The version I am using is 0.1. How can I check if what I have is newer than [3906]?

To reproduce.

• Create the blog with short name that consist of "bad/name".
• Go to blog main page. You will see the bad/name there.

comment:5 Changed 8 years ago by osimons

• Resolution set to fixed
• Status changed from reopened to closed

It does work with latest revision from repository. As you've noticed, I haven't put much effort into changing/tagging version yet...

I've updated the FullBlogPlugin with alternative methods of installing - including how to make sure you always get the latest from repository when installing.

easy_install --always-unzip http://trac-hacks.org/svn/fullblogplugin/0.11