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

[PATCH] Fix: Handle ampersand in branch names properly

From
AKAlexander Kurz <alexander.kurz@heliocentris.com>
Date
Oct 10, 2013, 14:19 UTC
Message-ID
<5256B78B.6050801@heliocentris.com>
Hello git maintainer crew,
  recently I stumbled about gitweb generating improper HTML after 
somebody merged from a branch contining an ampersand, e.g. branch 
name=fixes&features.
  Thanks, Alexander Kurz
>From beccd85ba8b8421213056883f31365f33d6e4490 Mon Sep 17 00:00:00 2001
From: kurz <kurz@DP-KURZ.heliocentris.com>
Date: Thu, 10 Oct 2013 16:09:46 +0200
Subject: [PATCH] Fix: Handle ampersand in branch names properly
---
 gitweb/gitweb.perl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 68c77f6..2963b1d 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2026,7 +2026,7 @@ sub format_ref_marker {
 				-href => href(
 					action=>$dest_action,
 					hash=>$dest
-				)}, $name);
+				)}, esc_attr($name));
 
 			$markers .= " <span class=\"".esc_attr($class)."\" title=\"".esc_attr($ref)."\">" .
 				$link . "</span>";
-- 
1.7.10.4
Message 1 of 1 in “Fix: Handle ampersand in branch names properly”
  1. Fix: Handle ampersand in branch names properlyAlexander Kurz, Oct 10, 2013

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.