gitweb: Introduce esc_attr to escape attributes of HTML elements
gitweb: Introduce esc_attr to escape attributes of HTML elements

It is needed only to escape attributes of handcrafted HTML elements,
and not those generated using CGI.pm subroutines / methods for HTML
generation.

While at it, add esc_url and esc_html where needed, and prefer to use
CGI.pm HTML generating methods than handcrafted HTML code.  Most of
those are probably unnecessary (could be exploited only by person with
write access to gitweb config, or at least access to the repository).

This fixes CVE-2010-3906

Reported-by: Emanuele Gentili <243c1f885d7b8838116a0a06905b1d5a5ec7b03d@tigersecurity.it>
Helped-by: John 'Warthog9' Hawley <1fad2220c5fd74dd015dca1a2da7c67b99aec535@kernel.org>
Helped-by: Jonathan Nieder <b57189c5f2fd5b3daf3350a77fde90def1080fa5@gmail.com>
Signed-off-by: Jakub Narebski <a6a1517a087f9f64a72f41a0de57ff01fbb0e412@gmail.com>
Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>

destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git