From: Jakub Narebski <jnareb@gmail.com>
To: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] gitweb: filter escapes from longer commit titles that break firefox
Date: Fri, 24 Apr 2009 19:53:35 +0200 [thread overview]
Message-ID: <200904241953.37187.jnareb@gmail.com> (raw)
In-Reply-To: <49EC78AB.6020009@windriver.com>
On Mon, 20 April 2009, Paul Gortmaker wrote:
> Jakub Narebski wrote:
>> Paul Gortmaker <paul.gortmaker@windriver.com> writes:
>>
>>
>>> If there is a commit that ends in ^X and is longer in length than
>>> what will fit in title_short, then it doesn't get fed through
>>> esc_html() and so the ^X will appear as-is in the page source.
>>>
>>> When Firefox comes across this, it will fail to display the page,
>>> and only display a couple lines of error messages that read like:
>>>
>>> XML Parsing Error: not well-formed
>>> Location: http://git ....
>>>
>>> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
>> But I do not think that the solution presented here is good solution
>> for this problem. chop_and_escape_str is meant as _output_ filter,
>> because it generates (can generate) fragment of HTML. It is not a
>> good solution to use it for shortening in intermediate representation
>> of %co{'title'}.
>>
>> And I think that issue might be a bug elsewhere in gitweb if we have
>> text output which is not passed through esc_html... or bug in CGI.pm
>> if the error is in not escaping of -title _attribute_ (attribute
>> escaping has slightly different rules than escaping HTML, and should
>> be done automatically by CGI.pm).
>>
>>
>> So thanks for noticing the issue, but NAK on the solution.
>
> Fair enough -- I wasn't familiar with the code in there, and there
> wasn't really any indication that it was for output only. I can easily
> believe that there is a better place for it -- I just didn't see where
> any global esc_html filtering was taking place...
The name chop_and_escape_str for this subroutine is not a very good
name; it rather should follow format_* as a naming convention for this
subroutine.
What more important is: can you find out in more detail _where_
an error (unescaped control character) occurs: is it tag contents or
'title' attribute for some tag, what tag is it (name and class), in
what view or views this bug is present, and in which part this occur?
Without those details it would b much harder to diagnose this bug...
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2009-04-24 17:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-17 16:24 [PATCH] gitweb: filter escapes from longer commit titles that break firefox Paul Gortmaker
2009-04-20 9:32 ` Jakub Narebski
2009-04-20 13:29 ` Paul Gortmaker
2009-04-24 17:53 ` Jakub Narebski [this message]
2009-04-24 19:48 ` Paul Gortmaker
2009-04-24 22:10 ` Jakub Narebski
2009-04-25 9:04 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200904241953.37187.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).