mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Using apache commons lang to escape html/xml from reports.
This commit is contained in:
parent
c0cb9ae9d0
commit
a8c03a3be3
@ -34,7 +34,7 @@ import java.util.Map.Entry;
|
||||
import java.util.TreeMap;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||
import org.sleuthkit.datamodel.*;
|
||||
@ -292,7 +292,7 @@ public class ReportHTML implements ReportModule {
|
||||
value = "";
|
||||
}
|
||||
value = ReportUtils.insertPeriodically(value, "<br>", 30);
|
||||
attributes.put(type, StringUtils.replaceEach(value, new String[]{"&", "\"", "<", ">"}, new String[]{"&", """, "<", ">"}));
|
||||
attributes.put(type, StringEscapeUtils.escapeHtml(value));
|
||||
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,7 @@ import java.util.Map.Entry;
|
||||
import java.util.TreeMap;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
@ -303,7 +304,7 @@ public class ReportXLS implements ReportModule {
|
||||
value = tempatt.getValueString();
|
||||
}
|
||||
|
||||
attributes.put(type, value);
|
||||
attributes.put(type, StringEscapeUtils.escapeXml(value));
|
||||
cc++;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user