You are here: Foswiki>Tasks Web>Item13202 (18 Nov 2016, MichaelDaum)Edit Attach

Item13202: sanitizeAttachmentName subroutine does not really apply a subset of the (default) NameFilter value

pencil
Priority: Enhancement
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: TopicInteractionPlugin
Branches:
Reported By: MarkusUeberall
Waiting For:
Last Change By: MichaelDaum
According to a comment in Foswiki::Plugins::TopicInteractionPlugin::Core::sanitizeAttachmentName, a subset of $Foswiki::cfg{NameFilter} is being removed. However, if you compare the applied RE to the one in Foswiki.spec, you see that while '\s' is not being removed, now parentheses are stripped as well which might be unexpected.

Suggestion: Remove the parentheses from the RE in question (trivial) or programmatically derive the filter/RE to be applied from $Foswiki::cfg{NameFilter} by explicitly stripping '\s' from the latter. Better yet, introduce a plugin-specific "relaxated filter" setting (a mapping expression) which as a side effect also documents the difference between NameFilter and what is being used here. This would allow to also keep the original mapping of spaces to underscores (might be helpful for older installations to ensure that there are no inconsistencies regarding the naming of attachments before/after installing this plugin or updating to a newer revision with this functionality).

-- MarkusUeberall - 11 Jan 2015

Confirming this ... helped Markus debug this the other day on irc. It's confusing where our documented NameFilter isn't used, and it's not documented anywhere in this plugin.

-- GeorgeClark - 12 Jan 2015

Fixed in 5.0

-- MichaelDaum - 18 Nov 2016
 

ItemTemplate edit

Summary sanitizeAttachmentName subroutine does not really apply a subset of the (default) NameFilter value
ReportedBy MarkusUeberall
Codebase 1.1.9
SVN Range
AppliesTo Extension
Component TopicInteractionPlugin
Priority Enhancement
CurrentState Closed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r3 - 18 Nov 2016, MichaelDaum
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