cf3880c50c550e4deb61c9664f4f994e13ab6dd8 max Mon Aug 17 08:05:58 2026 -0700 hgc/hgTracks: fix three items from the v502 code review, refs #38106 Shared BLAT alignment links (hgc g=htcBlatAlign) drew the page and then exit(0), which skips main's cartCheckout, so the loaded session was never written back and the recipient's cart ended up nearly empty. Add cartCheckout(&cart) before all four exit(0) calls that follow webEndGb(), including the two early error returns. squishCodonFont() decided FreeType was active with a looser test than maybeNewFonts(), missing the requirement that the font name match a row in freeTypeFonts[]; when they disagreed the bitmap engine got a cell height it cannot render. Factor the engine decision into freeTypeFontActive() and use it in both places. Query name, chrom and a hub's organism string went raw into single-quoted JS string literals and page titles on the modern alignment page; the shared-link path reads the query name back out of a bigPsl, so it is not covered by hgBlat's whitelist. javaScriptLiteralEncode the JS arguments and htmlEncode the HTML labels. Also add "u"/"s" (the shared-link session selectors) to hgc excludeVars so they are not left in the reader's cart. diff --git src/hg/hgTracks/config.c src/hg/hgTracks/config.c index 03505c16f85..67ce31d969e 100644 --- src/hg/hgTracks/config.c +++ src/hg/hgTracks/config.c @@ -1,1190 +1,1199 @@ /* config - put up track and display configuration page. */ /* Copyright (C) 2014 The Regents of the University of California * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */ #include "common.h" #include "dystring.h" #include "cheapcgi.h" #include "htmshell.h" #include "hdb.h" #include "hCommon.h" #include "cart.h" #include "web.h" #include "customTrack.h" #include "hgTracks.h" #include "trashDir.h" #include "hgConfig.h" #include "jsHelper.h" #include "imageV2.h" #include "search.h" #include "hubConnect.h" #include "fileUi.h" #include "trackHub.h" #include "versionInfo.h" static void themeDropDown(struct cart* cart) /* Create drop down for UI themes. * specfied in hg.conf like this * browser.theme.modern=background.png,HGStyle * */ { struct slName* themes = cfgNamesWithPrefix("browser.theme."); if (themes==NULL) return; slNameSort(&themes); hPrintf("
| "); hPrintf(" | ||
|---|---|---|
| "); hPrintf("", hgTrackUiName(), cartSessionVarName(), cartSessionId(cart), database, chromName, RULER_TRACK_NAME); hPrintf("%s", RULER_TRACK_LABEL); hPrintf(" | "); hTvDropDownClassVisOnlyWithLabel("ruler", rulerMode, FALSE, rulerMode ? "normalText trackVis" : "hiddenText trackVis", NULL, RULER_TRACK_LABEL); hPrintf(" | "); hPrintf("Chromosome position in bases. (Clicks here zoom in 3x)"); hPrintf(" |
| "); if (tdbIsSuperTrackChild(tdb)) /* indent members of a supertrack */ hPrintf(" "); hPrintIcons(tdb); if (track->hasUi) hPrintf("", tdb->parent ? "Part of super track: " : "Configure ", tdb->parent ? tdb->parent->shortLabel : tdb->shortLabel, hTrackUiForTrack(tdb->track), cartSessionVarName(), cartSessionId(cart), database, track->track); hPrintf(" %s", tdb->shortLabel); if (track->hasUi) hPrintf(""); hPrintf(" | "); if (tdbIsSuperTrackChild(tdb)) /* indent members of a supertrack */ hPrintf(" "); /* If track is not on this chrom print an informational message for the user. */ if (tdbIsDownloadsOnly(tdb)) // No vis display for downloadsOnly hPrintf("Downloads", hgFileUiName(),cartSessionVarName(), cartSessionId(cart), tdb->track); else if (hTrackOnChrom(track->tdb, chromName)) { if (tdbIsSuper(track->tdb)) { /* supertrack dropdown is hide/show */ superTrackDropDown(cart, track->tdb, 1); } else { /* check for option of limiting visibility to one mode */ hTvDropDownClassVisOnlyWithLabel(track->track, track->visibility, rTdbTreeCanPack(track->tdb), (track->visibility == tvHide) ? "hiddenText trackVis" : "normalText trackVis", trackDbSetting(track->tdb, "onlyVisibility"), tdb->shortLabel); } } else hPrintf("[No data-%s]", chromName); hPrintf(" | "); hPrintf("%s", tdb->longLabel); hPrintf(" |
| "); cgiDown(0.9); hPrintf(" | ||