Skip to content

Commit

Permalink
Item13423: Partial fix for escaping { in regex
Browse files Browse the repository at this point in the history
Query and Search have issues.  I've been unable to find where the
unescaped regexes are built.
  • Loading branch information
gac410 committed May 22, 2015
1 parent 360e029 commit b3d6eba
Show file tree
Hide file tree
Showing 41 changed files with 110 additions and 98 deletions.
2 changes: 1 addition & 1 deletion BuildContrib/lib/Foswiki/Contrib/Build.pm
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ sub filter_txt {

# Replace the version (SVN Rev or wrongly saved number) with rev 1.
# Item10629: Must preserve version for CompareRevisionAddOnDemoTopic, or nothing to demo
$text =~ s/^(%META:TOPICINFO{.*version=").*?(".*}%)$/${1}1$2/m
$text =~ s/^(%META:TOPICINFO\{.*version=").*?(".*\}%)$/${1}1$2/m
unless $from =~ m/CompareRevisionsAddOnDemoTopic.txt$/;
$text =~ s/%\$(\w+)%/&_expand($this,$1)/ge;
return $text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ sub _uploadTopic {

$form->{validation_key} = $this->_strikeone( $userAgent, $response );

$form->{text} =~ s/^%META:TOPICINFO{.*?\n//; # Delete any old topicinfo
$form->{text} =~ s/^%META:TOPICINFO\{.*?\n//; # Delete any old topicinfo
my $url =
"$this->{UPLOADTARGETSCRIPT}/save$this->{UPLOADTARGETSUFFIX}/$this->{UPLOADTARGETWEB}/$topic";
$form->{text} = <<EXTRA. $form->{text};
Expand Down
5 changes: 3 additions & 2 deletions CommentPlugin/test/unit/CommentPlugin/CommentPluginTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,11 @@ HERE
$this->assert_matches( qr/^BottomOfTopic.*^$comm/ms, $text );
}
elsif ( $type eq "above" ) {
$this->assert_matches( qr/^TopOfTopic.*^$comm.*$refexpr/ms, $text );
$this->assert_matches( qr/^TopOfTopic.*^$comm.*\Q$refexpr\E/ms,
$text );
}
elsif ( $type eq "below" ) {
$this->assert_matches( qr/$refexpr.*$comm.*^BottomOfTopic/ms,
$this->assert_matches( qr/\Q$refexpr\E.*$comm.*^BottomOfTopic/ms,
$text );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ sub commonTagsHandler {
"- ${pluginName}::commonTagsHandler( $_[2].$_[1] )")
if $debug;

$_[0] =~ s/%RDIFF2COMPARE{"?(.*?)"?}%/&_handleRdiff2Compare($1)/ge;
$_[0] =~ s/%RDIFF2COMPARE\{"?(.*?)"?\}%/&_handleRdiff2Compare($1)/ge;
}

sub _handleRdiff2Compare {

my $text = shift;
$text =~ s{/rdiff $Foswiki::cfg{ScriptSuffix}/}
$text =~ s{/rdiff $Foswiki::cfg\{ScriptSuffix\}/}
{/compare$Foswiki::cfg{ScriptSuffix}/}xmsg;
return $text;

Expand Down
4 changes: 2 additions & 2 deletions EditRowPlugin/lib/Foswiki/Plugins/EditRowPlugin/Table.pm
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ sub _getColsFromURPs {
my $val = $urps->{$cellName};

# Check current value for format-overriding EDITCELL
if ( $cell->{text} && $cell->{text} =~ /%EDITCELL{(.*?)}%/ ) {
if ( $cell->{text} && $cell->{text} =~ /%EDITCELL\{(.*?)\}%/ ) {
my %p = Foswiki::Func::extractParameters($1);
my $cd = $this->parseFormat( $p{_DEFAULT} );
$colDef = $cd->[0];
Expand Down Expand Up @@ -584,7 +584,7 @@ sub saveCellCmd {
my $ot = $this->{rows}->[$row]->{cols}->[$col]->{text};

my $nt = $urps->{CELLDATA};
if ( $ot =~ /(%EDITCELL{.*?}%)/ ) {
if ( $ot =~ /(%EDITCELL\{.*?\}%)/ ) {

# Restore the %EDITCELL
$nt = $1 . $nt;
Expand Down
4 changes: 2 additions & 2 deletions EditRowPlugin/lib/Foswiki/Plugins/EditRowPlugin/TableCell.pm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ sub render {
my $json = JSON->new()->convert_blessed();

my $text = $this->{text};
if ( $text =~ s/%EDITCELL{(.*?)}%// ) {
if ( $text =~ s/%EDITCELL\{(.*?)\}%// ) {
my %p = Foswiki::Func::extractParameters($1);
my $cd = $this->{row}->{table}->parseFormat( $p{_DEFAULT} );
$colDef = $cd->[0];
Expand Down Expand Up @@ -80,7 +80,7 @@ sub render {
else {

# Chop out meta-text
$text =~ s/%EDITCELL{(.*?)}%\s*$//;
$text =~ s/%EDITCELL\{(.*?)\}%\s*$//;
}
}

Expand Down
4 changes: 2 additions & 2 deletions EditRowPlugin/lib/Foswiki/Plugins/EditRowPlugin/TableRow.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ sub setRow {
if ( $n < scalar( @{ $this->{cols} } ) ) {

# Restore the EDITCELL from the old value, if present
if ( $val !~ /%EDITCELL{.*?}%/
&& $this->{cols}->[$n]->{text} =~ /(%EDITCELL{.*?}%)/ )
if ( $val !~ /%EDITCELL\{.*?\}%/
&& $this->{cols}->[$n]->{text} =~ /(%EDITCELL\{.*?\}%)/ )
{
$val .= $1;
}
Expand Down
4 changes: 2 additions & 2 deletions MailerContrib/lib/Foswiki/Contrib/MailerContrib/Change.pm
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ sub expandDiff {
$this->{TOPIC}, $this->{CURR_REV} );
return '' unless ( $b->haveAccess('VIEW') );
my $btext = Foswiki::Serialise::serialise( $b, 'Embedded' );
$btext =~ s/^%META:TOPICINFO{.*}%$//;
$btext =~ s/^%META:TOPICINFO\{.*\}%$//;

return $btext if ( $this->{BASE_REV} < 1 );

Expand All @@ -182,7 +182,7 @@ sub expandDiff {
$this->{TOPIC}, $this->{BASE_REV} );
return '' unless ( $a->haveAccess('VIEW') );
my $atext = Foswiki::Serialise::serialise( $a, 'Embedded' );
$atext =~ s/^%META:TOPICINFO{.*}%$//;
$atext =~ s/^%META:TOPICINFO\{.*\}%$//;

require Foswiki::Merge;
my $blocks = Foswiki::Merge::simpleMerge( $atext, $btext, qr/[\r\n]+/ );
Expand Down
2 changes: 1 addition & 1 deletion PlainFileStoreContrib/lib/Foswiki/Store/PlainFile.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ DONE
unless ($attachment) {
my $t = _readFile($latest);

$t =~ s/^%META:TOPICINFO{(.*)}%$//m;
$t =~ s/^%META:TOPICINFO\{(.*)\}%$//m;
$t =
'%META:TOPICINFO{author="'
. $Foswiki::Users::BaseUserMapping::UNKNOWN_USER_CUID
Expand Down
6 changes: 3 additions & 3 deletions RCSStoreContrib/lib/Foswiki/Store/Rcs/Handler.pm
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ sub _getTOPICINFO {
local $/ = "\n";
my $ti = <$f>;
close($f);
if ( defined $ti && $ti =~ /^%META:TOPICINFO{(.*)}%/ ) {
if ( defined $ti && $ti =~ /^%META:TOPICINFO\{(.*)\}%/ ) {
my $a = Foswiki::Attrs->new($1);

# Default bad revs to 1, not 0, because this is coming from
Expand Down Expand Up @@ -384,7 +384,7 @@ sub savePendingCheckin {
my $rev =
$this->revisionHistoryExists() ? $this->getLatestRevisionID() : 1;

$t =~ s/^%META:TOPICINFO{.*?}%\n//m;
$t =~ s/^%META:TOPICINFO\{.*?\}%\n//m;
$t =
'%META:TOPICINFO{author="'
. $Foswiki::Users::BaseUserMapping::UNKNOWN_USER_CUID
Expand All @@ -410,7 +410,7 @@ sub _cacheMetaInfo {
my $info;

# remove the previous record
if ( $text =~ s/^%META:TOPICINFO{(.*)}%\n//m ) {
if ( $text =~ s/^%META:TOPICINFO\{(.*)\}%\n//m ) {
$info = Foswiki::Attrs->new($1);

}
Expand Down
4 changes: 2 additions & 2 deletions RCSStoreContrib/lib/Foswiki/Store/Rcs/RcsLiteHandler.pm
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ sub revisionDiff {
my ($text2) = $this->getRevision($rev2);

# prevent diffing TOPICINFO
$text1 =~ s/^%META:TOPICINFO{(.*)}%\n//m;
$text2 =~ s/^%META:TOPICINFO{(.*)}%\n//m;
$text1 =~ s/^%META:TOPICINFO\{(.*)\}%\n//m;
$text2 =~ s/^%META:TOPICINFO\{(.*)\}%\n//m;

my $lNew = _split($text1);
my $lOld = _split($text2);
Expand Down
2 changes: 1 addition & 1 deletion RCSStoreContrib/lib/Foswiki/Store/Rcs/RcsWrapHandler.pm
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ sub revisionDiff {
);

# prevent diffing TOPICINFO
$tmp =~ s/^.%META:TOPICINFO{(.*)}%\n//mg;
$tmp =~ s/^.%META:TOPICINFO\{(.*)\}%\n//mg;

# comment out because we get a non-zero status for a good result!
#if( $exit ) {
Expand Down
12 changes: 6 additions & 6 deletions RCSStoreContrib/test/unit/RCSStoreContrib/RCSHandlerTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,8 @@ sub checkDifferences {
($to) = $rcs->getRevision(2);

# strip off all topic info
$from =~ s/^%META:TOPICINFO{(.*)}%\n//m;
$to =~ s/^%META:TOPICINFO{(.*)}%\n//m;
$from =~ s/^%META:TOPICINFO\{(.*)\}%\n//m;
$to =~ s/^%META:TOPICINFO\{(.*)\}%\n//m;

$rcs = $class->new( new StoreStub, $testWeb, $topic, "" );

Expand Down Expand Up @@ -771,7 +771,7 @@ sub verify_MissingVrestoreRev {
$this->assert( -e "$file,v" );

($text) = $rcs->getRevision(0);
$this->assert_matches( qr/^%META:TOPICINFO{.*?}%\nRev 1/, $text );
$this->assert_matches( qr/^%META:TOPICINFO\{.*?\}%\nRev 1/, $text );

unlink($file);
unlink("$file,v");
Expand Down Expand Up @@ -809,7 +809,7 @@ HERE
$this->assert( -e "$file,v" );

($text) = $rcs->getRevision(0);
$this->assert_matches( qr/^%META:TOPICINFO{.*?}%\n2/, $text );
$this->assert_matches( qr/^%META:TOPICINFO\{.*?\}%\n2/, $text );

unlink($file);
unlink("$file,v");
Expand Down Expand Up @@ -850,10 +850,10 @@ HERE
$this->assert_matches( qr/^Rev 1/, $text );

($text) = $rcs->getRevision(2);
$this->assert_matches( qr/^%META:TOPICINFO{.*?}%\nRev 2/, $text );
$this->assert_matches( qr/^%META:TOPICINFO\{.*?\}%\nRev 2/, $text );

($text) = $rcs->getRevision(0);
$this->assert_matches( qr/^%META:TOPICINFO{.*?}%\nRev 2/, $text );
$this->assert_matches( qr/^%META:TOPICINFO\{.*?\}%\nRev 2/, $text );

$rcs->deleteRevision();

Expand Down
4 changes: 2 additions & 2 deletions RenderListPlugin/lib/Foswiki/Plugins/RenderListPlugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ sub preRenderingHandler {
# Plugins, TOC and SEARCH can be rendered
if ( $_[0] =~ m/%RENDERLIST/ ) {
unless ( $_[0] =~
s/%RENDERLIST{(.*?)}%\s*(([\n\r]+[^ ]{3}[^\n\r]*)*?)(([\n\r]+ {3}[^\n\r]*)+)/&handleRenderList($1, $2, $4)/ges
s/%RENDERLIST\{(.*?)\}%\s*(([\n\r]+[^ ]{3}[^\n\r]*)*?)(([\n\r]+ {3}[^\n\r]*)+)/&handleRenderList($1, $2, $4)/ges
)
{

# Cairo compatibility fallback
$_[0] =~
s/%RENDERLIST{(.*?)}%\s*(([\n\r]+[^\t]{1}[^\n\r]*)*?)(([\n\r]+\t[^\n\r]*)+)/&handleRenderList($1, $2, $4)/ges;
s/%RENDERLIST\{(.*?)\}%\s*(([\n\r]+[^\t]{1}[^\n\r]*)*?)(([\n\r]+\t[^\n\r]*)+)/&handleRenderList($1, $2, $4)/ges;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion TablePlugin/lib/Foswiki/Plugins/TablePlugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ sub preRenderingHandler {
|| 'all';
return
unless ( $sort && $sort =~ m/^(all|attachments)$/ )
|| $_[0] =~ m/%TABLE{.*?}%/;
|| $_[0] =~ m/%TABLE\{.*?\}%/;

_readPluginSettings() if !%pluginAttributes;

Expand Down
2 changes: 1 addition & 1 deletion TablePlugin/lib/Foswiki/Plugins/TablePlugin/Core.pm
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ sub _processTableRow {
my $type = '';

# Fixup for EditRowPlugin - add ** if erpJS_sort
s/(.*)/*$1*/ if /erpJS_sort {headrows: \d/;
s/(.*)/*$1*/ if /erpJS_sort \{headrows: \d/;

if (/^\s*\*(.*)\*\s*$/) {
$value = $1;
Expand Down
4 changes: 2 additions & 2 deletions TopicUserMappingContrib/lib/Foswiki/Users/TopicUserMapping.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ sub _writeGroupTopic {
or ( $text =~ m/^(\t| )+\* Member list \(comma-separated list\):$/ )
or ( $text =~ m/^(\t| )+\* Persons\/group who can change the list:$/ )
or ( $text =~ m/^(\t| )+\* Set ALLOWTOPICCHANGE = .*$/ )
or ( $text =~ m/^\*%MAKETEXT{"Related topics:"}%.*$/ )
or ( $text =~ m/^\*%MAKETEXT\{"Related topics:"\}%.*$/ )
)
{
if ( !defined($allowChangeString) ) {
Expand All @@ -1013,7 +1013,7 @@ sub _writeGroupTopic {
$text =~ s/^(\t| )+\* Member list \(comma-separated list\):$//s;
$text =~ s/^(\t| )+\* Persons\/group who can change the list:$//s;
$text =~ s/^(\t| )+\* Set ALLOWTOPICCHANGE = .*$//s;
$text =~ s/^\*%MAKETEXT{"Related topics:"}%.*$//s;
$text =~ s/^\*%MAKETEXT\{"Related topics:"\}%.*$//s;

$text .= "\nEdit this topic to add a description to the $groupName\n";

Expand Down
8 changes: 5 additions & 3 deletions UnitTestContrib/test/unit/ConfigureQueryTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ sub test_getcfg_nokey {
my $reporter = Foswiki::Configure::Reporter->new();
Foswiki::Configure::Query::getcfg( $params, $reporter );
$this->assert( $reporter->has_level('errors') );
$this->assert_matches( qr/^{Peed}{Skills} not defined/,
$reporter->messages()->[0]->{text} );
$this->assert_matches(
qr/^\{Peed\}\{Skills\} not defined/,
$reporter->messages()->[0]->{text}
);
}

# For stripping parents in the spec tree if needed for print debug
Expand Down Expand Up @@ -232,7 +234,7 @@ sub test_getspec_badkey {
catch Error::Simple with {
my $mess = shift;
$this->assert_matches(
qr/^\$Not_found = {\s*\'keys\' => \'{BadKey}\'\s*};/, $mess );
qr/^\$Not_found = \{\s*\'keys\' => \'\{BadKey\}\'\s*\};/, $mess );
}
otherwise {
$this->assert(0);
Expand Down
41 changes: 25 additions & 16 deletions UnitTestContrib/test/unit/ConfigureSaveTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,20 @@ sub test_changecfg {

# Check report
my %expected = (
"| {OS} | ('') | \'$Foswiki::cfg{OS}\' |" => 'notes',
'| {\'Test-Key\'} | undef | \'newtestkey\' |' => 'notes',
'| {TestA} | undef | \'Shingle\' |' => 'notes',
'| {TestB}{Ruin} | undef | \'Ribbed\' |' => 'notes',
"| {OS} | ('') | \'$Foswiki::cfg{OS}\' |" => 'notes',
'| {\'Test-Key\'} | undef | \'newtestkey\' |' => 'notes',
'| {TestA} | undef | \'Shingle\' |' => 'notes',
'| {TestB}{Ruin} | undef | \'Ribbed\' |' => 'notes',
'| {UnitTestContrib}{Configure}{NUMBER} | (666) | \'99\' |', => 'notes',
'| {UnitTestContrib}{Configure}{PERL_ARRAY} | [5,6] | [3,4] |' => 'notes',
'| {UnitTestContrib}{Configure}{PERL_HASH} | {\'a\' => 5,\'b\' => 6} | {\'pootle\' => 1} |' => 'notes',
q<| {UnitTestContrib}{Configure}{REGEX} | ('^regex$') | '(black&#124;white)+' |> => 'notes',
'| {UnitTestContrib}{Configure}{undefok} | \'value\' | undef |' => 'notes',
);
'| {UnitTestContrib}{Configure}{PERL_ARRAY} | [5,6] | [3,4] |' =>
'notes',
'| {UnitTestContrib}{Configure}{PERL_HASH} | {\'a\' => 5,\'b\' => 6} | {\'pootle\' => 1} |'
=> 'notes',
q<| {UnitTestContrib}{Configure}{REGEX} | ('^regex$') | '(black&#124;white)+' |>
=> 'notes',
'| {UnitTestContrib}{Configure}{undefok} | \'value\' | undef |' =>
'notes',
);
my $ms = $reporter->messages();

#print STDERR Data::Dumper->Dump([$ms]);
Expand All @@ -81,15 +85,19 @@ sub test_changecfg {
$this->assert_str_equals( 'notes', $r->{level} );
$r = shift(@$ms);

for (my $i = 0; $i < scalar(@$ms); $i++) {
for ( my $i = 0 ; $i < scalar(@$ms) ; $i++ ) {
my $r = $ms->[$i];
if (($expected{$r->{text}}//'') eq $r->{level}) {
delete $expected{$r->{text}};
if ( ( $expected{ $r->{text} } // '' ) eq $r->{level} ) {
delete $expected{ $r->{text} };
}
}

#print STDERR Data::Dumper->Dump([$ms]);
$this->assert_num_equals(0, scalar keys %expected, Data::Dumper->Dump([\%expected]) );
$this->assert_num_equals(
0,
scalar keys %expected,
Data::Dumper->Dump( [ \%expected ] )
);

# Check it was written correctly
$this->assert( open( F, '<', $this->{lscpath} ), $@ );
Expand All @@ -98,9 +106,10 @@ sub test_changecfg {
close F;

# Check for expected messages
$this->assert_matches( qr/^# {'Test-Key'} was not found in .spec$/m, $c );
$this->assert_matches( qr/^# {TestA} was not found in .spec$/m, $c );
$this->assert_matches( qr/^# {TestB}{Ruin} was not found in .spec$/m, $c );
$this->assert_matches( qr/^# \{'Test-Key'\} was not found in .spec$/m, $c );
$this->assert_matches( qr/^# \{TestA\} was not found in .spec$/m, $c );
$this->assert_matches( qr/^# \{TestB\}\{Ruin\} was not found in .spec$/m,
$c );

# TODO: check backup succeeded

Expand Down
2 changes: 1 addition & 1 deletion UnitTestContrib/test/unit/Fn_INCLUDE.pm
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ Such a section!
Out of scope
THIS
my $handledTopicText = $topicText;
$handledTopicText =~ s/%(START|STOP|END)SECTION{"suction"}%//g;
$handledTopicText =~ s/%(START|STOP|END)SECTION\{"suction"\}%//g;

my ($inkyDink) =
Foswiki::Func::readTopic( $this->{other_web}, $includedTopic );
Expand Down
2 changes: 1 addition & 1 deletion UnitTestContrib/test/unit/Fn_SEARCH.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2157,7 +2157,7 @@ HERE

my $result =
$this->{test_topicObject}->expandMacros(
'%SEARCH{"^[%]META:FIELD{name=\"FieldA\".*\bvalue=\"A\";^[%]META:FIELD{name=\"FieldB\".*\bvalue=\"A\";^[%]META:FIELD{name=\"FieldC\".*\bvalue=\"A\";^[%]META:FIELD{name=\"FieldD\".*\bvalue=\"A\"|^[%]META:FIELD{name=\"FieldE\".*\bvalue=\"A\"" type="regex" nonoise="on" format="$topic" separator=" "}%'
'%SEARCH{"^[%]META:FIELD\{name=\"FieldA\".*\bvalue=\"A\";^[%]META:FIELD\{name=\"FieldB\".*\bvalue=\"A\";^[%]META:FIELD\{name=\"FieldC\".*\bvalue=\"A\";^[%]META:FIELD\{name=\"FieldD\".*\bvalue=\"A\"|^[%]META:FIELD\{name=\"FieldE\".*\bvalue=\"A\"" type="regex" nonoise="on" format="$topic" separator=" "}%'
);
my $retime = Benchmark::timediff( Benchmark->new(), $start );
$this->assert_str_equals( 'QueryTopic1 QueryTopic2', $result );
Expand Down
4 changes: 2 additions & 2 deletions UnitTestContrib/test/unit/Fn_SET.pm
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ sub set_up {
$Foswiki::cfg{TemplatePath} =
'$Foswiki::cfg{PubDir}/$web/$name.$skin.tmpl,$Foswiki::cfg{TemplateDir}/$web/$name.$skin.tmpl,$Foswiki::cfg{TemplateDir}/$name.$skin.tmpl,$Foswiki::cfg{TemplateDir}/$web/$name.tmpl,$Foswiki::cfg{TemplateDir}/$name.tmpl,$web.$skinSkin$nameTemplate,$Foswiki::cfg{SystemWebName}.$skinSkin$nameTemplate,$web.$nameTemplate,$Foswiki::cfg{SystemWebName}.$nameTemplate';
$Foswiki::cfg{TemplatePath} =~
s/\$Foswiki::cfg{TemplateDir}/$Foswiki::cfg{TemplateDir}/geo;
s/\$Foswiki::cfg\{TemplateDir\}/$Foswiki::cfg{TemplateDir}/geo;
$Foswiki::cfg{TemplatePath} =~
s/\$Foswiki::cfg{SystemWebName}/$Foswiki::cfg{SystemWebName}/ge;
s/\$Foswiki::cfg\{SystemWebName\}/$Foswiki::cfg{SystemWebName}/ge;

return;
}
Expand Down
2 changes: 1 addition & 1 deletion UnitTestContrib/test/unit/FoswikiTestCase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ sub set_up {

# Add the config unless already defined in LocalSite.cfg
$config =~
s/((\$Foswiki::cfg{.*?})\s*=.*?;)(?:\n|$)/push(@moreConfig, $1) unless (eval "exists $2"); ''/ges;
s/((\$Foswiki::cfg\{.*?\})\s*=.*?;)(?:\n|$)/push(@moreConfig, $1) unless (eval "exists $2"); ''/ges;
}
}
}
Expand Down
Loading

0 comments on commit b3d6eba

Please sign in to comment.