2b30b55d6a5b71648296873b570b9d68b4901b6a galt Wed Feb 15 02:21:56 2017 -0800 CSP code cleanup. Using jsInlineF where needed for compact and efficient code, not using fixed-size local javascript strings which could overflow. diff --git src/hg/hgBlat/hgBlat.c src/hg/hgBlat/hgBlat.c index 829dcba..69d1b83 100644 --- src/hg/hgBlat/hgBlat.c +++ src/hg/hgBlat/hgBlat.c @@ -216,34 +216,31 @@ void printLuckyRedirect(char *browserUrl, struct psl *psl, char *database, char *pslName, char *faName, char *uiState, char *unhideTrack) /* Print out a very short page that redirects us. */ { char url[1024]; safef(url, sizeof(url), "%s?position=%s:%d-%d&db=%s&ss=%s+%s&%s%s", browserUrl, psl->tName, psl->tStart + 1, psl->tEnd, database, pslName, faName, uiState, unhideTrack); /* htmlStart("Redirecting"); */ /* Odd it appears that we've already printed the Content-Typ:text/html line but I can't figure out where... */ htmStart(stdout, "Redirecting"); -char javascript[1024]; -safef(javascript, sizeof javascript, - "location.replace('%s');", url); -jsInline(javascript); +jsInlineF("location.replace('%s');", url); printf("<noscript>No javascript support:<br>Click <a href='%s'>here</a> for browser.</noscript>", url); htmlEnd(); } /* forward declaration to reduce churn */ static void getCustomName(char *database, struct cart *cart, struct psl *psl, char **pName, char **pDescription); void showAliPlaces(char *pslName, char *faName, char *customText, char *database, enum gfType qType, enum gfType tType, char *organism, boolean feelingLucky) /* Show all the places that align. */ { boolean useBigPsl = cfgOptionBooleanDefault("useBlatBigPsl", FALSE);