You are here: Foswiki>Tasks Web>Item4906 (08 Jan 2009, KwangErnLiew)Edit Attach

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

Priority: Normal
Current State: Closed
Released In: 1.0.0
Target Release: patch
Applies To: Engine
Reported By: TWiki:Main.KeWang
Waiting For: Main.KennethLavrsen
Last Change By: KwangErnLiew
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
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
Priority Normal
CurrentState Closed
WaitingFor KennethLavrsen
Checkins distro:d0aad1ee4369 distro:5c2ced1c48d2
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 K 22 Dec 2007 - 20:06 SteffenPoulsen patch against r16093
Topic revision: r15 - 08 Jan 2009, KwangErnLiew - This page was cached on 20 Jun 2019 - 11:03.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy