Skip to content

Commit 6822052

Browse files
jrngitster
authored andcommitted
gitweb: make logo optional
Some sites may not want to have a logo at all. While at it, use $cgi->img to simplify this code. (CGI.pm learned most HTML4 tags by version 2.79, so this should be portable to perl 5.8, though I haven't tested.) Signed-off-by: Jonathan Nieder <[email protected]> Acked-by: Jakub Narebski <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9d9f5e7 commit 6822052

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

gitweb/gitweb.perl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3501,10 +3501,15 @@ sub git_header_html {
35013501
insert_file($site_header);
35023502
}
35033503

3504-
print "<div class=\"page_header\">\n" .
3505-
$cgi->a({-href => esc_url($logo_url),
3506-
-title => $logo_label},
3507-
qq(<img src=").esc_url($logo).qq(" width="72" height="27" alt="git" class="logo"/>));
3504+
print "<div class=\"page_header\">\n";
3505+
if (defined $logo) {
3506+
print $cgi->a({-href => esc_url($logo_url),
3507+
-title => $logo_label},
3508+
$cgi->img({-src => esc_url($logo),
3509+
-width => 72, -height => 27,
3510+
-alt => "git",
3511+
-class => "logo"}));
3512+
}
35083513
print $cgi->a({-href => esc_url($home_link)}, $home_link_str) . " / ";
35093514
if (defined $project) {
35103515
print $cgi->a({-href => href(action=>"summary")}, esc_html($project));

0 commit comments

Comments
 (0)