Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
gitweb: fix $project usage
author
Matthias Lederhofer
<matled@gmx.net>
Sun, 6 Aug 2006 11:25:41 +0000
(13:25 +0200)
committer
Junio C Hamano
<junkio@cox.net>
Sun, 6 Aug 2006 20:50:43 +0000
(13:50 -0700)
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>
gitweb/gitweb.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
1568515
)
diff --git
a/gitweb/gitweb.perl
b/gitweb/gitweb.perl
index 08de2ce77ea12e40078b816001da15c466e79d17..b3bfc6bd9edf8634ff8c092d43d7e037eef034bf 100755
(executable)
--- a/
gitweb/gitweb.perl
+++ b/
gitweb/gitweb.perl
@@
-85,7
+85,10
@@
}
our $project = ($cgi->param('p') || $ENV{'PATH_INFO'});
}
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");
if (defined $project && $project) {
if (!validate_input($project)) {
die_error(undef, "Invalid project parameter");
@@
-874,11
+877,15
@@
sub git_header_html {
<title>$title</title>
<link rel="stylesheet" type="text/css" href="$stylesheet"/>
EOF
<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;\"/>" .
"<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;\"/>" .