threads / patch / 5789

patchgitweb: Escape ESCAPE (\e) character

Subject: [PATCH] gitweb: Escape ESCAPE (\e) character

## tl;dr

One message between Oct 2, 2006 and Oct 2, 2006. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Luben Tuikov· Oct 2, 2006, 21:54 UTC · lore

Take a look at commit 20a3847d8a5032ce41f90dcc68abfb36e6fee9b1 using gitweb before this patch. This patch fixes this.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 gitweb/gitweb.perl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Show changes to gitweb/gitweb.perl +1 −0
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 10e803a..a9e95c9 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -485,6 +485,7 @@ sub esc_html {
 	$str = decode("utf8", $str, Encode::FB_DEFAULT);
 	$str = escapeHTML($str);
 	$str =~ s/\014/^L/g; # escape FORM FEED (FF) character (e.g. in COPYING file)
+	$str =~ s/\033/^[/g; # "escape" ESCAPE (\e) character (e.g. commit 20a3847d8a5032ce41f90dcc68abfb36e6fee9b1)
 	return $str;
 }
 
-- 
1.4.2.3.gc269

← back to recent threads