src/lib/htmshell.c 1.53

1.53 2009/06/26 20:02:52 tdreszer
In warnBox sheild ' with HTML specil char is possible.
Index: src/lib/htmshell.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/htmshell.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -b -B -U 4 -r1.52 -r1.53
--- src/lib/htmshell.c	26 Jun 2009 17:42:15 -0000	1.52
+++ src/lib/htmshell.c	26 Jun 2009 20:02:52 -0000	1.53
@@ -229,10 +229,11 @@
     }
 
 char warning[512];
 vsnprintf(warning,sizeof(warning),format, args);
-// NOTE: While some HTML in the message should work, I believe a single quote (') will will screw it all up.  Thus replacing them with (")
-strSwapChar(warning,'\'','"');
+// NOTE: While some internal HTML should work, a single quote (') will will screw it all up!
+if( strSwapStrs(warning, sizeof(warning),"'","'") == -1) // Sheild single quotes
+    strSwapChar(warning,'\'','`');  // ran out of memory, replacing them with (`)
 printf("<script type='text/javascript'>{var warnList=document.getElementById('warnList'); warnList.innerHTML += '<li>%s</li>'; showWarnBox();}</script>\n",warning);
 
 #else//ifndef WARNBOX_IN_USE