From: Junio C Hamano Date: Wed, 9 Jan 2013 16:26:08 +0000 (-0800) Subject: Merge branch 'os/gitweb-highlight-uncaptured' X-Git-Tag: v1.8.2-rc0~160 X-Git-Url: https://www.git.lorimer.id.au/gitweb.git/diff_plain/fd6db678a1c6455eccd0b98a12f9907932e328e9?hp=85f269704890e71933ea90cd8e6b4ef23f51d620 Merge branch 'os/gitweb-highlight-uncaptured' The code to sanitize control characters before passing it to "highlight" filter lost known-to-be-safe control characters by mistake. * os/gitweb-highlight-uncaptured: gitweb: fix error in sanitize when highlight is enabled --- diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 656b324fb7..c6bafe6ead 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -1556,7 +1556,7 @@ sub sanitize { return undef unless defined $str; $str = to_utf8($str); - $str =~ s|([[:cntrl:]])|($1 =~ /[\t\n\r]/ ? $1 : quot_cec($1))|eg; + $str =~ s|([[:cntrl:]])|(index("\t\n\r", $1) != -1 ? $1 : quot_cec($1))|eg; return $str; }