aca9143822a9c12b16b33d479a5abb6495b6b4f0
braney
  Wed Aug 19 06:59:39 2026 -0700
lib, hgc, hgTables, hgHubConnect: share hubEncode, refs #38123

hgc.c and hgTables.c each had their own copy of hubEncode().  The two
bodies were identical, so move the function to hubConnect.c next to
isHubTrack() and let both CGIs call the one definition.

Also use cgiEncode() rather than htmlEncode() for the db= value in the
hgHubConnect assembly list.  That value goes in a query string, so
cgiEncode() is the right function there.  Genome names are already
limited to a safe character set, so this changes no output today.

diff --git src/hg/hgc/bigBedClick.c src/hg/hgc/bigBedClick.c
index 581afb8d859..88c809a5325 100644
--- src/hg/hgc/bigBedClick.c
+++ src/hg/hgc/bigBedClick.c
@@ -1,24 +1,25 @@
 /* Handle details pages for wiggle tracks. */
 
 /* Copyright (C) 2013 The Regents of the University of California 
  * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */
 
 #include "common.h"
 #include "wiggle.h"
 #include "cart.h"
 #include "hgc.h"
+#include "hubConnect.h"
 #include "hCommon.h"
 #include "hgColors.h"
 #include "bigBed.h"
 #include "hui.h"
 #include "subText.h"
 #include "web.h"
 #include "chromAlias.h"
 #include "quickLift.h"
 #include "hgConfig.h"
 #include "jsHelper.h"
 #include "jsonParse.h"
 #include "jsonWrite.h"
 
 static void bigGenePredLinks(char *track, char *item)
 /* output links to genePred driven sequence dumps */