src/hg/near/hgNear/hgNear.c 1.186
1.186 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/hgNear.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/near/hgNear/hgNear.c,v
retrieving revision 1.185
retrieving revision 1.186
diff -b -B -U 4 -r1.185 -r1.186
--- src/hg/near/hgNear/hgNear.c 20 Nov 2009 19:17:35 -0000 1.185
+++ src/hg/near/hgNear/hgNear.c 7 May 2010 03:37:41 -0000 1.186
@@ -18,9 +18,8 @@
#include "ra.h"
#include "hgColors.h"
#include "hgNear.h"
#include "versionInfo.h"
-#include "hPrint.h"
static char const rcsid[] = "$Id$";
char *excludeVars[] = { "submit", "Submit", idPosVarName, NULL };
@@ -402,9 +402,9 @@
{
if (col->selfLink)
{
selfAnchorId(gp);
- hPrintNonBreak(s);
+ hPrintEncodedNonBreak(s);
hPrintf("</A>");
}
else if (col->itemUrl != NULL)
{
@@ -430,14 +430,14 @@
hPrintf("\"");
if (!col->useHgsid)
hPrintf(" TARGET=_blank");
hPrintf(">");
- hPrintNonBreak(s);
+ hPrintEncodedNonBreak(s);
hPrintf("</A>");
}
else
{
- hPrintNonBreak(s);
+ hPrintEncodedNonBreak(s);
}
freeMem(s);
}
hPrintf("</TD>");
@@ -549,9 +549,10 @@
if (s == NULL)
s = cloneString("n/a");
hPrintf("<TD>");
selfAnchorId(gp);
-hPrintf("%s</A></TD>", s);
+hPrintEncodedNonBreak(s);
+hPrintf("</A></TD>");
freeMem(s);
}
struct genePos *weedUnlessInHash(struct genePos *inList, struct hash *hash)