Skip to content

Commit

Permalink
Item9103: use windows backslash for paths - should we make a $Foswiki…
Browse files Browse the repository at this point in the history
…::cfg{dirSlash} , or should we make a Foswiki::Sandbox::makepath that _every_ file path should go through?

git-svn-id: http://svn.foswiki.org/trunk@7625 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
SvenDowideit authored and SvenDowideit committed Jun 4, 2010
1 parent 4dc15d7 commit 7b0472e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/lib/Foswiki/Configure/UIs/EXTEND.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ use warnings;
use Foswiki::Configure::UI ();
our @ISA = ('Foswiki::Configure::UI');
use Foswiki::Configure::Util ();
use File::Temp ();
#use File::Temp ();
#please explain why its there if its not used..
use File::Copy ();
use File::Spec ();
use Cwd ();
Expand Down
8 changes: 7 additions & 1 deletion core/lib/Foswiki/Configure/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ sub mapTarget {
&& ( $file eq 'data/mime.types' ) )
{
$file =~ s#^data/mime\.types$#$Foswiki::cfg{MimeTypesFileName}#;
#force to windows paths
$file =~ s/\//\\/g if ($^O eq 'MSWin32');

return $file;
}

Expand Down Expand Up @@ -136,14 +139,17 @@ sub mapTarget {
elsif ( $file =~ s#^(bin/\w+)$#$root$1$Foswiki::cfg{ScriptSuffix}# ) {

#This makes a couple of bad assumptions
#1. that the twiki's bin dir _is_ called bin
#1. that the foswiki's bin dir _is_ called bin
#2. that any file going into there _is_ a script - making installing the
# .htaccess file via this machanism impossible
#3. that softlinks are not in use (same issue below)
}
else {
$file = File::Spec->catfile( $root, $file );
}
#force to windows paths
$file =~ s/\//\\/g if ($^O eq 'MSWin32');

return $file;
}

Expand Down

0 comments on commit 7b0472e

Please sign in to comment.