src/hg/near/hgNear/flyBase.c 1.2

1.2 2010/05/07 03:37:41 galt
using htmlEncode via new function hPrintEncodeNonBreak to protect against problems with <>;" in output, problem was recently uncovered by hgNearTest
Index: src/hg/near/hgNear/flyBase.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/near/hgNear/flyBase.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -B -U 1000000 -r1.1 -r1.2
--- src/hg/near/hgNear/flyBase.c	29 Oct 2003 16:31:52 -0000	1.1
+++ src/hg/near/hgNear/flyBase.c	7 May 2010 03:37:41 -0000	1.2
@@ -1,43 +1,43 @@
 /* flyBase.c - handle flybase stuff. */
 
 #include "common.h"
 #include "linefile.h"
 #include "hash.h"
 #include "jksql.h"
 #include "cart.h"
 #include "hdb.h"
 #include "hCommon.h"
 #include "obscure.h"
 #include "hgNear.h"
 
 static char const rcsid[] = "$Id$";
 
 static char *flyTxToGene(char *tx)
 /* Convert transcript to gene (by cutting off '-') */
 {
 char *e = strchr(tx, '-');
 if (e == NULL)
     return cloneString(tx);
 else
     return cloneStringZ(tx, e-tx);
 }
 
 static void flyBdgpCellPrint(struct column *col, struct genePos *gp,
 	struct sqlConnection *conn)
 /* Print trancript name and link to fruitfly.org. */
 {
 char *geneName = flyTxToGene(gp->name);
 hPrintf("<TD><A HREF=\"");
 hPrintf(col->itemUrl, geneName);
 hPrintf("\" TARGET=_blank>");
-hPrintf("%s", gp->name);
+hPrintEncodedNonBreak(gp->name);
 hPrintf("</A></TD>");
 }
 
 void setupColumnFlyBdgp(struct column *col, char *parameters)
 /* Set up Bdgp gene column. */
 {
 setupColumnAcc(col, parameters);
 col->cellPrint = flyBdgpCellPrint;
 }