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

Re: [PATCH (bugfix)] gitweb: Add and use prep_attr helper

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Sep 15, 2010, 20:40 UTC
Message-ID
<AANLkTi=o2PFB=JkO5wYHCLAHCO=Ebe63mAc6WB8GfktH@mail.gmail.com>
In-Reply-To
<201009152234.14253.jnareb@gmail.com>
2010/9/15 Jakub Narebski <jnareb@gmail.com>:
Show 11 quoted lines
> One of features of CGI.pm module is HTML generation.  The HTML
> generation subroutines / methods automatically escape values of
> attributes of HTML elements... but in older versions didn't do it
> fully, not removing / replacing control characters.  Control
> characters are forbidden in XML / XHTML, and some browsers
> (e.g. Firefox) do not skip over them but display error instead of page
> in strict XHTML mode (XHTML DTD + application/xml+html mimetype).
>
> This issue was noticed by Uwe Kleine-König and resolved to be a
> problem with control characters in XHTML output by Ævar Arnfjörð
> Bjarmason in format_search_author() subroutine.

FWIW this looks good to me, but perhaps instead of using "?" for everything in ASCII from \0 to " " it would be better to display the human-readable escape sequence, like "\r" or "\b".

Gitweb already does this (although I don't have a link handy) if you check in a file with Windows newlines, it'll display "\r" in a little box.

Maybe that should be done everywhere? I don't know.
Previous: Jakub NarebskiNext: Junio C Hamano
Message 2 of 4 in “gitweb: Add and use prep_attr helper”
  1. gitweb: Add and use prep_attr helperJakub Narebski, Sep 15, 2010
  2. Ævar Arnfjörð BjarmasonSep 15, 2010
  3. Junio C HamanoSep 15, 2010
  4. Jakub NarebskiSep 15, 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.