author | Jakub Narebski <jnareb@gmail.com> | |
Tue, 28 Feb 2012 18:41:47 +0000 (19:41 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 28 Feb 2012 19:45:31 +0000 (11:45 -0800) | ||
commit | 36612e4daf8b5b5eaf16315aa13c66925f878cd6 | |
tree | 910d07215d5ce41fc0faf0656af6758a7248edaa | tree | snapshot |
parent | f174a2583c9f42315b60205890fa67a79a1f1669 | commit | diff |
gitweb: Handle invalid regexp in regexp search
When using regexp search ('sr' parameter / $search_use_regexp variable
is true), check first that regexp is valid.
Without this patch we would get an error from Perl during search (if
searching is performed by gitweb), or highlighting matches substring
(if applicable), if user provided invalid regexp... which means broken
HTML, with error page (including HTTP headers) generated after gitweb
already produced some output.
Add test that illustrates such error: for example for regexp "*\.git"
we would get the following error:
Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE \.git/
at /var/www/cgi-bin/gitweb.cgi line 3084.
Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When using regexp search ('sr' parameter / $search_use_regexp variable
is true), check first that regexp is valid.
Without this patch we would get an error from Perl during search (if
searching is performed by gitweb), or highlighting matches substring
(if applicable), if user provided invalid regexp... which means broken
HTML, with error page (including HTTP headers) generated after gitweb
already produced some output.
Add test that illustrates such error: for example for regexp "*\.git"
we would get the following error:
Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE \.git/
at /var/www/cgi-bin/gitweb.cgi line 3084.
Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/gitweb.perl | diff | blob | history | |
t/t9501-gitweb-standalone-http-status.sh | diff | blob | history |