From dd04c428cfea1d9dd7684bbd9e2919fbad051b26 Mon Sep 17 00:00:00 2001 From: Matthias Lederhofer Date: Sun, 6 Aug 2006 13:25:41 +0200 Subject: 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 --- gitweb/gitweb.perl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'gitweb') diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 08de2ce77e..b3bfc6bd9e 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" . "