make ' ' and '+' in filenames some kind of working
Kay Sievers committed
Nov 14, 2005 at 06:10 UTC
182167100f707eda8ab543b1b36e19f777ebe67a
1 file changed
+5
-5
gitweb.cgi
+5
-5
@@ -144,7 +144,7 @@ sub validate_input {
144
if ($input =~ m/(^|\/)(|\.|\.\.)($|\/)/) {
145
return undef;
146
}
147
- if ($input =~ m/[^a-zA-Z0-9_\.\/\-\+\#\~]/) {
147
+ if ($input =~ m/[^a-zA-Z0-9_ \.\/\-\+\#\~]/) {
148
return undef;
149
}
150
return $input;
@@ -209,8 +209,8 @@ if (!defined $action || $action eq "summary") {
209
210
sub esc {
211
my $str = shift;
212
- $str =~ s/ /\+/g;
213
- $str =~ s/\+/%2b/g;
212
+ $str =~ s/ /%20/g;
213
+ $str =~ s/\+/%2B/g;
214
return $str;
215
}
216
@@ -580,7 +580,7 @@ sub git_diff_print {
580
close $fd;
581
}
582
583
- open my $fd, "-|", "/usr/bin/diff -u -p -L $from_name -L $to_name $from_tmp $to_tmp";
583
+ open my $fd, "-|", "/usr/bin/diff -u -p -L \'$from_name\' -L \'$to_name\' $from_tmp $to_tmp";
584
if ($format eq "plain") {
585
undef $/;
586
print <$fd>;
@@ -2029,7 +2029,7 @@ sub git_history {
2029
"</div>\n";
2030
print "<div class=\"page_path\"><b>/$file_name</b><br/></div>\n";
2031
2032
- open my $fd, "-|", "$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin $file_name";
2032
+ open my $fd, "-|", "$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin \'$file_name\'";
2033
my $commit;
2034
print "<table cellspacing=\"0\">\n";
2035
my $alternate = 0;