Foswiki on GitHub is open for business! Next release meeting: Monday September 29, 1300Z

Item4906: Filename of attachments containing a wikiword inside ( ) messes up the file attachment table and other UI

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Engine   Main.KennethLavrsen
When a filename contains a wikiword surrounded by parenthesizes is attached to a page. It messes up the file attachment table. The only way to fix it is remove it from the table manually by directly editing the page source through ftp.

-- TWiki:Main/KeWang - 29 Oct 2007

is this bug still present in 4.2.0?

-- SvenDowideit - 06 Dec 2007

I do not have an install of 4.2.0 to test it on. If anyone has 4.2.0, please test this out and give us update here.

-- TWiki:Main.KeWang - 14 Dec 2007

Well, we have 4.2 here...

I don't see anything wrong on LitterTray.AtachmentWithParentheses.

-- TWiki:Main.ArthurClemens - 14 Dec 2007

Try uploading a filename like

Existing(WebChanges)And(NonExisting)And([[ForcedName]])Not[[InParanthesis]]FilenameWithA(WikiName)And( SpacedOut ).txt

And it will show the effect - the filename could be entity-escaped, noautolinked or similar to avoid the rendering effects.

- It is currently not possible to upload to dto due to the "Use of uninitialized value in hash element at (eval 98) line 3."-error reported elsewhere, so can't demonstrate.

-- TWiki:Main.SteffenPoulsen - 15 Dec 2007

Yes, the renamed messages says:
The file has been uploaded and attached properly to the AtachmentWithParentheses topic. However, the filename has been changed from Existing(WebChanges)And(NonExisting? )And([[ForcedName]])Not[[InParanthesis]]FilenameWithA(WikiName? )And( SpacedOut? ).txt to Existing(WebChanges)And(NonExisting? )And([[ForcedName]])Not[[InParanthesis]]FilenameWithA(WikiName? )And(_SpacedOut_).txt. Please make a note of it.

I have updated the summary to better describe this bug.

-- TWiki:Main.ArthurClemens - 17 Dec 2007

One strategy is to prevent the rendering, a. la.:

Another to rename the file after upload. I think the first is the best one, it covers existing files as well?

-- TWiki:Main.SteffenPoulsen - 22 Dec 2007

Not sure if this is still relevant, but you don't need square brackets to error the thing out. A simple filename like
TestingThis(JustParenthesizes).txt
would not work either as you can see at AtachmentWithParentheses. I currently have the rename rules to take out parenthesizes out of any filenames which seems to fix the issue but isn't a very good work around. A fix at the rendering level would be ideal imo.

-- TWiki:Main.KeWang - 22 Dec 2007

I have no problems with Parentheses, however a filename such as #5b.txt has some odd behaviors.

  • if you go to manage the file, you can not modify properties. The "Change comment and properties only" button does not even show up, nor does an option to delete it.
  • the automatically generated URL for downloading the document from the wiki page also fails #5b.txt: #5b.txt will lead you to an error page, because the link terminates at the pound symbol and TWiki 4.1.5 is trying to access the pub/WEB/PageName/ directory.

-- TWiki:Main.AJAlfieriCrispin - 18 Mar 2008

Correction, you only get an error if your apache is configured to disallow directory browsing... BTW, do you want directory browsing allowed on this site?

-- TWiki:Main.AJAlfieriCrispin - 18 Mar 2008

yeah, its ben useful once or twice when people try to track down bugs

-- TWiki:Main.SvenDowideit - 31 Mar 2008

Not sure how so many developers managed to screw the original bug report into something it was not.

The original report addressed filenames with wikiword inside paranthesis.

That also covers over other types of similar issues. We simply do not want to render filenames as TML anywhere.

Steffen was on the right track

I am testing his fixes and implementing the unit test updates that are required.

ItemTemplate edit

Summary Filename of attachments containing a wikiword inside ( ) messes up the file attachment table and other UI
ReportedBy TWiki:Main.KeWang
Codebase trunk
SVN Range TWiki-4.3.0, Fri, 12 Oct 2007, build 15261
AppliesTo Engine
Component
Priority Normal
CurrentState Closed
WaitingFor KennethLavrsen
Checkins Foswikirev:1570 Foswikirev:1572
TargetRelease patch
ReleasedIn 1.0.0
Topic attachments
I Attachment Action Size Date Who Comment
prevent_filename_rendering_patch.txttxt prevent_filename_rendering_patch.txt manage 2.7 K 22 Dec 2007 - 20:06 SteffenPoulsen patch against r16093
Topic revision: r15 - 08 Jan 2009, KwangErnLiew
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License