Item13202: sanitizeAttachmentName subroutine does not really apply a subset of the (default) NameFilter value
Priority: Enhancement
Current State: Closed
Released In: n/a
Target Release: n/a
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