{"thread":{"id":"9079","subject":"gitweb: get_file_owner and XML special characters","startedAt":"2007-07-17T20:06:37Z","lastAt":"2007-07-17T20:06:37Z","messageCount":1,"participants":["Eddie Kohler"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"47667","messageId":"469D214D.7030101@cs.ucla.edu","threadId":"9079","inReplyTo":null,"subject":"gitweb: get_file_owner and XML special characters","fromName":"Eddie Kohler","fromEmail":"kohler@cs.ucla.edu","sentAt":"2007-07-17T20:06:37Z","receivedAt":"2007-07-17T20:06:37Z","isPatch":false,"sender":{"key":"kohler@cs.ucla.edu","avatar":null},"body":"Hi,\n\nI think current gitweb generates invalid XHTML when get_file_owner returns a \nstring containing <>&.  (Version 1.5.2.1 certainly does, and in a quick browse \nof current source I didn't notice relevant changes.)\n\nHere is a dirty patch to fix this problem.  Apologies if it is no longer a \nproblem or if the patch is gross.\nThanks,\nEddie (newbie)\n\n\n\n>From 1c6ba7b6b28808cea0f2f9ab46733ddefdac329a Mon Sep 17 00:00:00 2001\nFrom: Eddie Kohler <kohler@cs.ucla.edu>\nDate: Tue, 17 Jul 2007 13:06:08 -0700\nSubject: [PATCH] Escape HTML special characters in file owner\n\n---\n gitweb/gitweb.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex c8ba3a2..540d9a6 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2050,7 +2050,7 @@ sub get_file_owner {\n \t}\n \tmy $owner = $gcos;\n \t$owner =~ s/[,;].*$//;\n-\treturn to_utf8($owner);\n+\treturn $cgi->escapeHTML(to_utf8($owner));\n }\n \n ## ......................................................................\n-- \n1.5.2.2\n\n"}]}