author | Jakub Narebski <jnareb@gmail.com> | |
Tue, 14 Dec 2010 15:54:31 +0000 (16:54 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 14 Dec 2010 19:03:41 +0000 (11:03 -0800) | ||
commit | 67976c65e0e931ad73ec21e5effe3dc204003df4 | |
tree | 28972da0898203ce8683005f7a3f80d814cfd82e | tree | snapshot |
parent | c6d059bbccb8460959b9aedfeefbb4d6aac6e842 | commit | diff |
gitweb: Fix handling of whitespace in generated links
When creating path_info part of link, don't encode space as '+', because
while $cgi->param('foo') translates '+' in query param to ' ', neither
$ENV{'PATH_INFO'} nor $cgi->path_info() do.
This fixes the issue with pathnames with embedded whitespace and
$feature{'pathinfo'} / path_info links. It is done by using newly
introduced esc_path_info() instead of esc_url() in href() subroutine.
Also while links are more clear not escaping space (' ') characters in
generated links, the trailing space must be URI-encoded, otherwise would
get discarded.
Issue noticed thanks to John 'Warthog9' Hawley.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When creating path_info part of link, don't encode space as '+', because
while $cgi->param('foo') translates '+' in query param to ' ', neither
$ENV{'PATH_INFO'} nor $cgi->path_info() do.
This fixes the issue with pathnames with embedded whitespace and
$feature{'pathinfo'} / path_info links. It is done by using newly
introduced esc_path_info() instead of esc_url() in href() subroutine.
Also while links are more clear not escaping space (' ') characters in
generated links, the trailing space must be URI-encoded, otherwise would
get discarded.
Issue noticed thanks to John 'Warthog9' Hawley.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/gitweb.perl | diff | blob | history |