summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ba6ef81)
raw | patch | inline | side by side (parent: ba6ef81)
author | Luben Tuikov <ltuikov@yahoo.com> | |
Thu, 28 Sep 2006 23:51:43 +0000 (16:51 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 29 Sep 2006 01:58:16 +0000 (18:58 -0700) |
Do not use quotemeta on internally generated strings
such as filenames of snapshot, blobs, etc.
quotemeta quotes any characters not matching /A-Za-z_0-9/.
Which means that we get strings like this:
before: linux\-2\.6\.git\-5c2d97cb31fb77981797fec46230ca005b865799\.tar\.gz
after: linux-2.6.git-5c2d97cb31fb77981797fec46230ca005b865799.tar.gz
This patch fixes this.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
such as filenames of snapshot, blobs, etc.
quotemeta quotes any characters not matching /A-Za-z_0-9/.
Which means that we get strings like this:
before: linux\-2\.6\.git\-5c2d97cb31fb77981797fec46230ca005b865799\.tar\.gz
after: linux-2.6.git-5c2d97cb31fb77981797fec46230ca005b865799.tar.gz
This patch fixes this.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 8ad04570a8ae486989ea190d1395a8db4b072a34..a99e116a4a6ec487d5a0118e2ef845215341404a 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
print $cgi->header(
-type => "$type",
-expires=>$expires,
- -content_disposition => 'inline; filename="' . quotemeta($save_as) . '"');
+ -content_disposition => 'inline; filename="' . "$save_as" . '"');
undef $/;
binmode STDOUT, ':raw';
print <$fd>;
print $cgi->header(
-type => 'application/x-tar',
-content_encoding => $ctype,
- -content_disposition => 'inline; filename="' . quotemeta($filename) . '"',
+ -content_disposition => 'inline; filename="' . "$filename" . '"',
-status => '200 OK');
my $git_command = git_cmd_str();
my @views_nav = ();
if (defined $file_name && defined $co{'parent'}) {
- my $parent = $co{'parent'};
push @views_nav,
$cgi->a({-href => href(action=>"blame", hash_parent=>$parent, file_name=>$file_name)},
"blame");
-type => 'text/plain',
-charset => 'utf-8',
-expires => $expires,
- -content_disposition => 'inline; filename="' . quotemeta($file_name) . '.patch"');
+ -content_disposition => 'inline; filename="' . "$file_name" . '.patch"');
print "X-Git-Url: " . $cgi->self_url() . "\n\n";
-type => 'text/plain',
-charset => 'utf-8',
-expires => $expires,
- -content_disposition => 'inline; filename="' . quotemeta($filename) . '"');
+ -content_disposition => 'inline; filename="' . "$filename" . '"');
my %ad = parse_date($co{'author_epoch'}, $co{'author_tz'});
print <<TEXT;
From: $co{'author'}