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
Junio C Hamano <junkio@cox.net>
Date
Nov 9, 2006, 01:10 UTC
Message-ID
<7vwt65pgqs.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200611090146.25306.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 12 quoted lines
> Junio C Hamano wrote:
>> Jakub Narebski <jnareb@gmail.com> writes:
>> 
>>> 1. First, esc_path should _not_ use subroutine which does it's own 
>>> contol characters escaping. That was also a mistake I made in my patch.
>>> Perhaps we should have some quot_html or to_html subroutine which does 
>>> _only_ to_utf8 (decode from Encode module), escapeHTML and optionally 
>>> s/ /&nbsp;/g conversion.
>> 
>> I hated that original arrangement, 
>
> What did you hate, again?
esc_path calling esc_html you mentioned, of course.
Show 8 quoted lines
>> obviously wrong in the output with the patch you are responding
>> to.  Except that git_blame2 is missing a chomp() on "my $data"
>> after finishing the metainfo loop, that is.
>
> The original (mine) code for esc_path uses esc_html, which did it's
> own partial (very partial) special characters esaping, namely
> \014 (\f) => ^L, \033 (\e) => ^[. So if pathname had form feed character,
> it would be replaced by ^L, not '\f'.
I know -- that is what I meant by "code reuse and consistency".
> You have added quot_cec to esc_html subroutine directly. I don't know
> what is your version of esc_html after the changes you
> made,...
See "pu".
> Well, the pathname has the limit that it must be in single line
> after quoting. The "blob" output is multipage.

I honestly have _no_ idea what distincition you are seeing here. Both blob and diff output are processed one line at a time and its result would be on a single line too.

Previous: Jakub NarebskiNext: Jakub Narebski
Message 5 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.