* This class is used to filter javascript tags to avoid XSS attacks.
*/
public class XSSFilter {
-
- // private static String[] filterChars = { "<", ">", "<", ">", "\"", "\\", "0x" };
-// private static String[] replacementChars = { " ", " ", " ", " ", "'", "/", "0 x" };
-
-/* public static synchronized String filterRequest(String param) {
- String value = param;
-
- if (param != null) {
-
- for (int i = 0; i < filterChars.length; i++) {
- value = filterCharacters(filterChars[i], replacementChars[i],
- value);
- }
-
- }
-
- return value;
-
- }
-*/
public static synchronized String filterRequestOnlyScript(String param) {
String value = "";
return value;
}
-
-// private static synchronized String filterCharacters(String originalChar, String newChar,
-// String param) {
-// StringBuffer sb = new StringBuffer(param);
-//
-// for (int position = param.toLowerCase().indexOf(originalChar); position >= 0;) {
-// sb.replace(position, position + originalChar.length(), newChar);
-// param = sb.toString();
-// position = param.toLowerCase().indexOf(originalChar);
-// }
-//
-// return sb.toString();
-// }
public static void main (String args[]) {
String value = XSSFilter.filterRequest("<s\nC\nr\nI\np\nT\n>\na\nl\ne\nr\nt\n('sundar');</SCRIPT>javascript:alert('Sundar');");
setColSpan(colSpan);
} // ColumnHeader
- //public ColumnHeader(String columnTitle, String columnWidth, int colSpan, String linkColId) {
- //this(columnTitle, columnWidth, colSpan);
- //setLinkColId(linkColId);
- //} // ColumnHeader
-
public ColumnHeader(String columnTitle, String columnWidth, String alignment, int colSpan, String linkColId) {
this(columnTitle, columnWidth, colSpan);
setAlignment(alignment);
return (s == null) ? "" : s;
}
-// private String nvl(String s, String sDefault) {
-// return nvl(s).equals("") ? sDefault : s;
-// }
-
public String getAlignment() {
return alignment;
}
throws RaptorException {
this.colId = colId;
DataSet ds = ConnectionUtils.getDataSet(loadValuesSQL, dbInfo);
- // DataSet ds = DbUtils.executeQuery(loadValuesSQL);
columnValues = new Vector(ds.getRowCount());
for (int i = 0; i < ds.getRowCount(); i++)
columnValues.add(ds.getString(i, 0));
return getDisplayValueHtml();
else
return getFormattedLink(getValueHtml());
- // return getFormattedValue("<a
- // href=\""+drillDownURL+"\">"+getValueHtml()+"</a>");
} // getDisplayValueLinkHtml
public String getAlignmentHtml() {
sb.append("font-style:italic;");
if (isUnderline())
sb.append("text-decoration:underline;");
- // if(getBgColor().length()>0)
- // sb.append("background-color:"+getBgColor()+";");
if (getFontColor().length() > 0)
sb.append("color:" + getFontColor() + ";");
if (getFontFace().length() > 0)
sb.append("font-style:italic;");
if (isUnderline())
sb.append("text-decoration:underline;");
- // if(getBgColor().length()>0)
- // sb.append("background-color:"+getBgColor()+";");
if (getFontColor().length() > 0)
sb.append("color:" + getFontColor() + ";");
if (getFontFace().length() > 0)