From: Matthias Lederhofer Date: Sun, 6 Aug 2006 11:25:41 +0000 (+0200) Subject: gitweb: fix $project usage X-Git-Tag: v1.4.3-rc1~274^2~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=dd04c428cfea1d9dd7684bbd9e2919fbad051b26;p=git.git gitweb: fix $project usage There were some places where $project was used even if it was not defined. Signed-off-by: Matthias Lederhofer Signed-off-by: Junio C Hamano --- diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 08de2ce77..b3bfc6bd9 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -85,7 +85,10 @@ if (defined $action) { } our $project = ($cgi->param('p') || $ENV{'PATH_INFO'}); -$project =~ s|^/||; $project =~ s|/$||; +if (defined $project) { + $project =~ s|^/||; + $project =~ s|/$||; +} if (defined $project && $project) { if (!validate_input($project)) { die_error(undef, "Invalid project parameter"); @@ -874,11 +877,15 @@ sub git_header_html { $title EOF - print "\n" . - "\n"; + if (defined $project) { + printf(''."\n", + esc_param($project), + esc_param("$my_uri?p=$project;a=rss")); + } - print "\n" . + print "\n" . + "\n" . "
\n" . "" . "\"git\"" .