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

Re: [PATCH 2/2] gitweb: Protect escaping functions against calling on undef

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 17, 2010, 16:26 UTC
Message-ID
<201002171726.53418.jnareb@gmail.com>
In-Reply-To
<20100207205130.11146.30664.stgit@localhost.localdomain>
On Sun, 7 Feb 2010, Jakub Narebski wrote:
Show 14 quoted lines
> This is a bit of future-proofing esc_html and friends: when called
> with undefined value they would now would return undef... which would
> probably mean that error would still occur, but closer to the source
> of problem.
> 
> This means that we can safely use
>   esc_html(shift) || "Internal Server Error"
> in die_error() instead of
>   esc_html(shift || "Internal Server Error")
> 
> Signed-off-by: Jakub Narebski <jnareb@gmail.com>
> ---
> Without the second part (i.e. the change in die_error) those two
> patches would be totally independent.
Ping!

All but last chunk (last chunk depends on PATCH 1/2) are a bit of hardening / defensive programming... although currently not necessary (gitweb doesn't pass undef to its escaping subroutines... I think).

-- 
Jakub Narebski
Poland
Previous: Jakub Narebski
Message 5 of 5 in “gitweb: Improve escaping”
  1. 0/2 gitweb: Improve escapingJakub Narebski, Feb 7, 2010
  2. 1/2 gitweb: esc_html (short) error message in die_errorJakub Narebski, Feb 7, 2010
  3. Jakub NarebskiFeb 17, 2010
  4. 2/2 gitweb: Protect escaping functions against calling on undefJakub Narebski, Feb 7, 2010
  5. Jakub NarebskiFeb 17, 2010

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.