gitweb: get_file_owner and XML special characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I think current gitweb generates invalid XHTML when get_file_owner returns a string containing <>&. (Version 1.5.2.1 certainly does, and in a quick browse of current source I didn't notice relevant changes.)

Here is a dirty patch to fix this problem. Apologies if it is no longer a problem or if the patch is gross.
Thanks,
Eddie (newbie)

>From 1c6ba7b6b28808cea0f2f9ab46733ddefdac329a Mon Sep 17 00:00:00 2001
From: Eddie Kohler <kohler@xxxxxxxxxxx>
Date: Tue, 17 Jul 2007 13:06:08 -0700
Subject: [PATCH] Escape HTML special characters in file owner

---
 gitweb/gitweb.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c8ba3a2..540d9a6 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2050,7 +2050,7 @@ sub get_file_owner {
 	}
 	my $owner = $gcos;
 	$owner =~ s/[,;].*$//;
-	return to_utf8($owner);
+	return $cgi->escapeHTML(to_utf8($owner));
 }
 
 ## ......................................................................
-- 
1.5.2.2


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux