Skip to content

Commit

Permalink
Item13278: Ensure regex defaults agree with cfg values
Browse files Browse the repository at this point in the history
This fixes configure, but there are some operational issues.

The NameFilter regex is passed verbatim to the NAMEFILTER variable in
the DOM.  core/pub/System/JavascriptFiles/foswikiWebTopicCreator_src.js
then uses it to filter topic names.

However the {NameFilter} regex saved by configure is incompatible with
javascript, so the filter fails.
  • Loading branch information
gac410 committed Feb 26, 2015
1 parent 773c939 commit a80b428
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/lib/Foswiki/Configure/LoadSpec.pm
Expand Up @@ -388,6 +388,16 @@ sub parse {
# being sensitive to changes.
$open->{default} = $1;

# Configure treats all regular expressions as simple quoted string,
# Convert from qr/ / notation to a simple quoted string
if ( $open->{typename} eq 'REGEX' && $open->{default} =~ m/^qr/ ) {
my $value = eval "$open->{default}";

# Strip off useless furniture (?^: ... )
$value =~ s/^\(\?\^:(.*)\)$/$1/;
$open->{default} = "$value";
}

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

0 comments on commit a80b428

Please sign in to comment.