Skip to content

Commit

Permalink
gitweb: fix $project usage
Browse files Browse the repository at this point in the history
There were some places where $project was used even if it was not
defined.

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Matthias Lederhofer authored and Junio C Hamano committed Aug 6, 2006
1 parent 1568515 commit dd04c42
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@
}

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");
Expand Down Expand Up @@ -874,11 +877,15 @@ sub git_header_html {
<title>$title</title>
<link rel="stylesheet" type="text/css" href="$stylesheet"/>
EOF
print "<link rel=\"alternate\" title=\"" . esc_param($project) . " log\" href=\"" .
"$my_uri?" . esc_param("p=$project;a=rss") . "\" type=\"application/rss+xml\"/>\n" .
"</head>\n";
if (defined $project) {
printf('<link rel="alternate" title="%s log" '.
'href="%s" type="application/rss+xml"/>'."\n",
esc_param($project),
esc_param("$my_uri?p=$project;a=rss"));
}

print "<body>\n" .
print "</head>\n" .
"<body>\n" .
"<div class=\"page_header\">\n" .
"<a href=\"http://www.kernel.org/pub/software/scm/git/docs/\" title=\"git documentation\">" .
"<img src=\"$logo\" width=\"72\" height=\"27\" alt=\"git\" style=\"float:right; border-width:0px;\"/>" .
Expand Down

0 comments on commit dd04c42

Please sign in to comment.