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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/9/15 Jakub Narebski <jnareb@xxxxxxxxx>:
> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]