{"thread":{"id":"5693","subject":"[laroche@redhat.com: gitweb.cgi]","startedAt":"2006-09-25T16:19:34Z","lastAt":"2006-09-25T16:32:22Z","messageCount":2,"participants":["Florian La Roche","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"27624","messageId":"20060925161934.GA18951@dudweiler.stuttgart.redhat.com","threadId":"5693","inReplyTo":null,"subject":"[laroche@redhat.com: gitweb.cgi]","fromName":"Florian La Roche","fromEmail":"laroche@redhat.com","sentAt":"2006-09-25T16:19:34Z","receivedAt":"2006-09-25T16:19:34Z","isPatch":false,"sender":{"key":"laroche@redhat.com","avatar":null},"body":"Hello git crew,\n\nI'm not a big perl prorammer, but the following removes perl\nwarnings about accessing undefined vars.\n\nregards,\n\nFlorian La Roche\n\n\n--- gitweb/gitweb.perl\n+++ gitweb/gitweb.perl\n@@ -427,7 +427,9 @@ sub esc_html {\n \tmy $str = shift;\n \t$str = decode(\"utf8\", $str, Encode::FB_DEFAULT);\n \t$str = escapeHTML($str);\n-\t$str =~ s/\\014/^L/g; # escape FORM FEED (FF) character (e.g. in COPYING file)\n+\tif (defined $str) {\n+\t\t$str =~ s/\\014/^L/g; # escape FORM FEED (FF) character (e.g. in COPYING file)\n+\t}\n \treturn $str;\n }\n \n@@ -2860,10 +2819,14 @@ sub git_log {\n \t\tmy $ref = format_ref_marker($refs, $commit);\n \t\tmy %co = parse_commit($commit);\n \t\tnext if !%co;\n+\t\tmy $esc_title = $co{'title'};\n+\t\tif (defined $esc_title) {\n+\t\t\t$esc_title = esc_html($esc_title);\n+\t\t}\n \t\tmy %ad = parse_date($co{'author_epoch'});\n \t\tgit_print_header_div('commit',\n \t\t               \"<span class=\\\"age\\\">$co{'age_string'}</span>\" .\n-\t\t               esc_html($co{'title'}) . $ref,\n+\t\t               $esc_title . $ref,\n \t\t               $commit);\n \t\tprint \"<div class=\\\"title_text\\\">\\n\" .\n \t\t      \"<div class=\\\"log_link\\\">\\n\" .\n"},{"id":"27626","messageId":"ef90an$4ua$1@sea.gmane.org","threadId":"5693","inReplyTo":"20060925161934.GA18951@dudweiler.stuttgart.redhat.com","subject":"Re: [laroche@redhat.com: gitweb.cgi]","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-09-25T16:32:22Z","receivedAt":"2006-09-25T16:32:22Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Florian La Roche wrote:\n\n> Hello git crew,\n> \n> I'm not a big perl prorammer, but the following removes perl\n> warnings about accessing undefined vars.\n[...] \n> --- gitweb/gitweb.perl\n> +++ gitweb/gitweb.perl\n> @@ -427,7 +427,9 @@ sub esc_html {\n>       my $str = shift;\n>       $str = decode(\"utf8\", $str, Encode::FB_DEFAULT);\n>       $str = escapeHTML($str);\n> -     $str =~ s/\\014/^L/g; # escape FORM FEED (FF) character (e.g. in COPYING file)\n> +     if (defined $str) {\n> +             $str =~ s/\\014/^L/g; # escape FORM FEED (FF) character (e.g. in COPYING file)\n> +     }\n>       return $str;\n>  }\n> \nIt would be better to just use\n\n        my $str = shift;\n        return '' unless defined $str;\n\nand neither your change in esc_html, nor the change below should be needed. \nBy the way, commit without title? But it would be better if correct it, to\nset $co{'title'} to an empty string, either in git_log or in parse_commit.\n \n> @@ -2860,10 +2819,14 @@ sub git_log {\n>               my $ref = format_ref_marker($refs, $commit);\n>               my %co = parse_commit($commit);\n>               next if !%co;\n> +             my $esc_title = $co{'title'};\n> +             if (defined $esc_title) {\n> +                     $esc_title = esc_html($esc_title);\n> +             }\n>               my %ad = parse_date($co{'author_epoch'});\n>               git_print_header_div('commit',\n>                              \"<span class=\\\"age\\\">$co{'age_string'}</span>\" .\n> -                            esc_html($co{'title'}) . $ref,\n> +                            $esc_title . $ref,\n>                              $commit);\n>               print \"<div class=\\\"title_text\\\">\\n\" .\n>                     \"<div class=\\\"log_link\\\">\\n\" .\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"}]}