Skip to content

Commit

Permalink
Item13378: fixes for UseLocale being activated, and some missed calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Comment committed May 15, 2015
1 parent 302fb0e commit 0daec05
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 27 deletions.
Expand Up @@ -52,11 +52,8 @@ sub _checkDir {
Foswiki::Configure::FileUtil::findFileOnTree( $ddir, qr/,v$/, qr/,pfv$/ );

if ($bad) {
$reporter->ERROR(
'Choose one of the RCS stores. Loss of history possible if this setting is saved!'
);
$reporter->WARN(
'RCS files detected, Migrate RCS files using =tools/change_store.pl=.'
'RCS ,v files detected. Loss of the history stored in these files is possible if you continue with the PlainFile store. You may want to consider migrating RCS files using =tools/change_store.pl=, or choosing one of the RCS stores.'
);
$reporter->NOTE("First RCS file encountered: $bad");
return 1;
Expand Down
4 changes: 3 additions & 1 deletion PlainFileStoreContrib/lib/Foswiki/Store/PlainFile.pm
Expand Up @@ -888,7 +888,9 @@ sub removeSpuriousLeases {
my $file = $webdir . $f;
if ( $file =~ m/^(.*)\.lease$/ ) {
if ( !-e "$1,pfv" ) {
unlink($file);

# Implicit untaint
unlink("$1.lease");
}
}
}
Expand Down
24 changes: 6 additions & 18 deletions UnitTestContrib/test/unit/Fn_ICON.pm
Expand Up @@ -114,45 +114,33 @@ sub test_PUBURL {
my $t = Foswiki::Func::expandCommonVariables('%PUBURL%');
$this->assert_URI_equals(
"$Foswiki::cfg{DefaultUrlHost}$Foswiki::cfg{PubUrlPath}", $t );
$t = Foswiki::Func::expandCommonVariables('%PUBURL{web="Web"}%');
$t = Foswiki::Func::expandCommonVariables('%PUBURL{path="Web"}%');
$this->assert_URI_equals(
"$Foswiki::cfg{DefaultUrlHost}$Foswiki::cfg{PubUrlPath}/Web", $t );
$t =
Foswiki::Func::expandCommonVariables('%PUBURL{web="Web" topic="Topic"}%');
$t = Foswiki::Func::expandCommonVariables('%PUBURL{path="Web.Topic"}%');
$this->assert_URI_equals(
"$Foswiki::cfg{DefaultUrlHost}$Foswiki::cfg{PubUrlPath}/Web/Topic",
$t );
$t = Foswiki::Func::expandCommonVariables(
'%PUBURL{web="Web" topic="Topic" attachment="att.dat"}%');
'%PUBURL{path="Web.Topic" "att.dat"}%');
$this->assert_URI_equals(
"$Foswiki::cfg{DefaultUrlHost}$Foswiki::cfg{PubUrlPath}/Web/Topic/att.dat",
$t
);
$t = Foswiki::Func::expandCommonVariables(
'%PUBURL{web="Web" topic="Topic" attachment="att.dat" x="y"}%');
$this->assert_URI_equals(
"$Foswiki::cfg{DefaultUrlHost}$Foswiki::cfg{PubUrlPath}/Web/Topic/att.dat?x=y",
$t
);
}

sub test_PUBURLPATH {
my $this = shift;
my $t = Foswiki::Func::expandCommonVariables('%PUBURLPATH%');
$this->assert_URI_equals( $Foswiki::cfg{PubUrlPath}, $t );
$t = Foswiki::Func::expandCommonVariables('%PUBURLPATH{web="Web"}%');
$t = Foswiki::Func::expandCommonVariables('%PUBURLPATH{path="Web"}%');
$this->assert_URI_equals( "$Foswiki::cfg{PubUrlPath}/Web", $t );
$t = Foswiki::Func::expandCommonVariables(
'%PUBURLPATH{web="Web" topic="Topic"}%');
$t = Foswiki::Func::expandCommonVariables('%PUBURLPATH{path="Web.Topic"}%');
$this->assert_URI_equals( "$Foswiki::cfg{PubUrlPath}/Web/Topic", $t );
$t = Foswiki::Func::expandCommonVariables(
'%PUBURLPATH{web="Web" topic="Topic" attachment="att.dat"}%');
'%PUBURLPATH{path="Web.Topic" "att.dat"}%');
$this->assert_URI_equals( "$Foswiki::cfg{PubUrlPath}/Web/Topic/att.dat",
$t );
$t = Foswiki::Func::expandCommonVariables(
'%PUBURLPATH{web="Web" topic="Topic" attachment="att.dat" p="q"}%');
$this->assert_URI_equals( "$Foswiki::cfg{PubUrlPath}/Web/Topic/att.dat?p=q",
$t );
}

sub test_ATTACHURL {
Expand Down
2 changes: 1 addition & 1 deletion UnitTestContrib/test/unit/InitFormTests.pm
Expand Up @@ -112,7 +112,7 @@ sub set_up {
# FW 1.2 and later
$aurl =
$this->{session}
->getPubURL( web => $testweb, topic => $testform, absolute => 1 );
->getPubURL( $testweb, $testform, undef, absolute => 1 );
}
else {
# up to FW 1.1.9
Expand Down
6 changes: 3 additions & 3 deletions UnitTestContrib/test/unit/ViewScriptTests.pm
Expand Up @@ -225,7 +225,8 @@ sub setup_view {
);

my $editUrl =
$this->{session}->getScriptUrl( '0', 'edit', $this->{test_web}, '' );
$this->{session}
->getScriptUrl( '0', 'edit', $this->{test_web}, 'WebHome' );

$text =~ s/\r//g;
$text =~ s/(^.*?\n\n+)//s; # remove CGI header
Expand Down Expand Up @@ -307,8 +308,7 @@ HERE
$hdr, "contenttype=text/plain should return text/plain - got $hdr" );
$this->assert_does_not_match( qr#<(noautolink|nop)>#, $text,
"autolink or nop found in text skin" );
$this->assert_equals( "$topic2plain", $text,
"Unexpected output from contentype=text/plain skin=text" );
$this->assert_equals( $topic2plain, $text );

return;
}
Expand Down

0 comments on commit 0daec05

Please sign in to comment.