git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb: protect blob and diff output lines from controls.

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 9, 2006, 10:41 UTC
Message-ID
<200611091141.42205.jnareb@gmail.com>
In-Reply-To
<7v8xiklxh1.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 14 quoted lines
> Jakub Narebski <jnareb@gmail.com> writes:
>> Junio C Hamano wrote:
>>> [...]  There is another
>>> thing I noticed while testing it with an artifitial test that I
>>> haven't fixed, but I think you already know about it (when the
>>> commitdiff is completely empty except mode changes, we end up
>>> with unbalanced div).  My test's tip can be found at
>>> 'gitweb-test-funny-char' branch temporarily in the git.git
>>> repository.
>>
>> Damn. I thought I corrected this on resend...
> 
> I think you need this, otherwise when the last filepair changes
> only metainfo you fail to close the extended header div.

True, I forgot about the situation where empty patch is _last_ in the patchset (which includes the situation when it is _only_ patch).

Show 9 quoted lines
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 1a757cc..e54a29e 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -2338,6 +2338,8 @@ sub git_patchset_body {
>  
>  		print format_diff_line($patch_line);
>  	}
> +	print "</div>\n" if $in_header; # extended header
I would write '# class="diff extended_header"' here instead.
> +
>  	print "</div>\n" if $patch_found; # class="patch"
>  
>  	print "</div>\n"; # class="patchset"
Looks good. Ack.
-- 
Jakub Narebski
Previous: Junio C HamanoNext: Luben Tuikov
Message 11 of 12 in “gitweb: protect blob and diff output lines from controls.”
  1. gitweb: protect blob and diff output lines from controls.Junio C Hamano, Nov 8, 2006
  2. Jakub NarebskiNov 9, 2006
  3. Junio C HamanoNov 9, 2006
  4. Jakub NarebskiNov 9, 2006
  5. Junio C HamanoNov 9, 2006
  6. Jakub NarebskiNov 9, 2006
  7. Jakub NarebskiNov 9, 2006
  8. Junio C HamanoNov 9, 2006
  9. Jakub NarebskiNov 9, 2006
  10. Junio C HamanoNov 9, 2006
  11. Jakub NarebskiNov 9, 2006
  12. Luben TuikovNov 10, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.