git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitweb: escape tag comments

From
DDDaniel Drake <dsd@gentoo.org>
Date
Jul 24, 2006, 22:07 UTC
Message-ID
<20060724220723.B5B6C7E3E43@zog.reactivated.net>

I have a tag with a comment which includes an & character. Firefox wouldn't display my gitweb summary page due to malformed XML. This solves the problem.

Signed-off-by: Daniel Drake <dsd@gentoo.org>
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 2fd1e5f..5acd66d 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -1138,7 +1138,7 @@ sub git_summary {
 				      "</td>\n" .
 				      "<td>";
 				if (defined($comment)) {
-				      print $cgi->a({-class => "list", -href => "$my_uri?" . esc_param("p=$project;a=tag;h=$tag{'id'}")}, $comment);
+				      print $cgi->a({-class => "list", -href => "$my_uri?" . esc_param("p=$project;a=tag;h=$tag{'id'}")}, esc_html($comment));
 				}
 				print "</td>\n" .
 				      "<td class=\"link\">";
Message 1 of 1 in “gitweb: escape tag comments”
  1. gitweb: escape tag commentsDaniel Drake, Jul 24, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.