Item1814: ATTACHEDFILELINKFORMAT expands $name counter-intuitively

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Engine    
The expansion of $name in ATTACHEDFILELINKFORMAT is bad:
  • the first occurrence expands to the url-encoded version of the filename
  • the second occurrence expands to the "normal" filename
  • any further occurrences are not expanded at all

see Foswiki::Attach::getAttachmentLink()

I propose
  • to introduce $url which expands to the url-encoded representation
  • and to change the default behaviour of $name to always expand to "the normal filename"

This will break backward-compatibility for those, who have a custom ATTACHEDFILELINKFORMAT setting.

I would like to make those changes. Any objections/concerns?

-- OliverKrueger - 09 Jul 2009

Go for it. /me thinks of a bad code award.

-- MichaelDaum - 10 Jul 2009

Added $filename and $fileurl instead of kicking $name. Added docs in FileAttachment and changed default settings in DefaultPreferences.

-- OliverKrueger - 23 Jul 2009

ItemTemplate edit

Summary ATTACHEDFILELINKFORMAT expands $name counter-intuitively
ReportedBy OliverKrueger
Codebase
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component
Priority Normal
CurrentState Closed
WaitingFor
Checkins Foswikirev:4539
TargetRelease minor
ReleasedIn 1.1.0
Topic revision: r6 - 04 Oct 2010, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License