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

Re: [PATCH] gitweb: Consolidate escaping/validation of query string

From
Jakub Narebski <jnareb@gmail.com>
Date
Sep 24, 2006, 12:21 UTC
Message-ID
<200609241421.21930.jnareb@gmail.com>
In-Reply-To
<20060924113613.GM20017@pasky.or.cz>
Petr "Pasky" Baudis wrote:
Show 11 quoted lines
>>> I have also made esc_param() escape [?=&;]. Not escaping [&;] was downright
>>> buggy and [?=] just feels better escaped. ;-) YMMV.
> ..snip..
>> I'd rather have new esc_param() or esc_param_value() quote like escape
>> subroutine from CGI::Util, with the esception of _not_ escaping '/'
>> (it makes funny bookmark, and lot less readable query string), and rename
>> current esc_param() to esc_query_string() or esc_params().
> 
> Huh, well, what's the point with the rename and why not keep it as it is
> with just removing the four characters above? Escaped stuff looks ugly
> in a URL. ;-)

There are few places where we escape whole URL (so I'd prefer esc_url() for current implementation): esc_param($home_link) and soon esc_param($githelp_url) (and _not_ esc_html($githelp_url)). And those URLs can contain query strings, so we cannot escape '?', ';' and '&', '=' there.

Before introduction of href() subroutine we escaped using esc_param the whole query string, hence esc_param did not escaped [?=&;].

-- 
Jakub Narebski
Poland
Previous: Petr BaudisNext: Petr Baudis
Message 5 of 7 in “gitweb: Consolidate escaping/validation of query string”
  1. gitweb: Consolidate escaping/validation of query stringPetr Baudis, Sep 23, 2006
  2. Jakub NarebskiSep 23, 2006
  3. Jakub NarebskiSep 23, 2006
  4. Petr BaudisSep 24, 2006
  5. Jakub NarebskiSep 24, 2006
  6. gitweb: Consolidate escaping/validation of query stringPetr Baudis, Sep 24, 2006
  7. Jakub NarebskiSep 24, 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.