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/hgTables/hgTables.h src/hg/hgTables/hgTables.h
index 07c7d919dd2..661de7c4b1c 100644
--- src/hg/hgTables/hgTables.h
+++ src/hg/hgTables/hgTables.h
@@ -40,33 +40,30 @@
 extern struct trackDb *curTrack;	/* Currently selected track. */
 extern struct grp *fullGroupList;	/* List of all groups. */
 extern struct grp *curGroup;	/* Currently selected group. */
 extern struct customTrack *theCtList;	/* List of custom tracks. */
 extern char *curTable;	/* Current selected table. */
 extern struct joiner *allJoiner;	/* Info on how to join tables. */
 
 #define GALAXY_URL_BASE "https://usegalaxy.org"
 #define GALAXY_URL_APP GALAXY_URL_BASE "/tool_runner"
 
 /* --------------- HTML Helpers ----------------- */
 
 void hPrintSpaces(int count);
 /* Print a number of non-breaking spaces. */
 
-char *hubEncode(struct trackDb *tdb, char *text);
-/* Return text escaped for HTML if it belongs to a track hub, otherwise return it unchanged. */
-
 void writeHtmlCell(char *text);
 /* Write out a cell in an HTML table, making text not too big,
  * and stripping html tags and breaking spaces.... */
 
 void htmlOpen(char *format, ...)
 /* Start up a page that will be in html format. */
 #if defined(__GNUC__)
 __attribute__((format(printf, 1, 2)))
 #endif
 ;
 
 void htmlClose();
 /* Close down html format page. */
 
 void textOpen();