Skip to content

Commit

Permalink
Item13917: More NameFilter & REGEX fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gac410 committed Jan 12, 2016
1 parent e6fcf91 commit a117856
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/lib/Foswiki.spec
Expand Up @@ -981,13 +981,13 @@ $Foswiki::cfg{UploadFilter} = '^((?i)\.htaccess|.*\.(?i)(?:php[0-9s]?(\..*)?|[sp
# include paths and skin names. This is a filter *out*, so if any of the
# characters matched by this expression are seen in names, they will be
# removed.
$Foswiki::cfg{NameFilter} = '[\s*?~^$@%`"\'&|<:>\[\]#\x00-\x1f]';
$Foswiki::cfg{NameFilter} = '[\\s*?~^$@%`"\'&|<:>\[\]#\x00-\x1f]';

# **REGEX LABEL="Attachment Name Filter" EXPERT**
# Filter-out regex file attachment names. This is a filter *out*, so if any of the
# characters matched by this expression are seen in an attachment name, they will be
# removed.
$Foswiki::cfg{AttachmentNameFilter} = '[*?~^$@%`"\'&|<>\[\]#\x00-\x1f]';
$Foswiki::cfg{AttachmentNameFilter} = '[\*?~^$@%`"\'&|<>\[\]#\x00-\x1f]';

# **BOOLEAN LABEL="Replace Attachment Spaces" EXPERT**
# Enable this parameter if you want the old behavior of replacing spaces in an attachment filename
Expand Down
6 changes: 5 additions & 1 deletion core/lib/Foswiki/Configure/LoadSpec.pm
Expand Up @@ -404,9 +404,13 @@ sub parse {

# Convert quoting for a single-quoted string. All we
# need to do is protect single quote
$open->{default} =~ s/'/\\\\'/g;
$open->{default} =~ s/'/\\'/g;
$open->{default} = "'" . $open->{default} . "'";
}
elsif ( $open->{typename} eq 'REGEX' ) {
$open->{default} =~
s/\\'/'/g; # unescape any escaped ' for quoted string.
}

$open->{keys} = $keys;
unless ($isEnhancing) {
Expand Down

0 comments on commit a117856

Please sign in to comment.