new method for sanitizing content to be rendered on a web page (specifically, the routerInfo options can be hacked to contain evil html)

thanks for finding and suggesting the fix oOo!
This commit is contained in:
jrandom
2004-08-11 04:42:04 +00:00
committed by zzz
parent 007194d674
commit fbe9fe1ba8
2 changed files with 16 additions and 6 deletions

View File

@ -528,6 +528,16 @@ public class DataHelper {
return (ms / (24 * 60 * 60 * 1000)) + "d";
}
}
/**
* Strip out any HTML (simply removing any less than / greater than symbols)
*/
public static String stripHTML(String orig) {
if (orig == null) return "";
String t1 = orig.replace('<', ' ');
String rv = t1.replace('>', ' ');
return rv;
}
/** compress the data and return a new GZIP compressed array */
public static byte[] compress(byte orig[]) {