diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java
index 54fa7b6b7e..0f8360231b 100644
--- a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java
+++ b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java
@@ -1,4 +1,4 @@
- /*
+/*
*
* Autopsy Forensic Browser
*
@@ -719,8 +719,7 @@ class ReportHTML implements TableReportModule {
*/
public String saveContent(AbstractFile file, String dirName) {
// clean up the dir name passed in
- String dirName2 = dirName.replace("/", "_");
- dirName2 = dirName2.replace("\\", "_");
+ String dirName2 = org.sleuthkit.autopsy.coreutils.FileUtil.escapeFileName(dirName);
// Make a folder for the local file with the same tagName as the tag.
StringBuilder localFilePath = new StringBuilder(); // full path
@@ -840,13 +839,13 @@ class ReportHTML implements TableReportModule {
StringBuilder index = new StringBuilder();
final String reportTitle = reportBranding.getReportTitle();
String iconPath = reportBranding.getAgencyLogoPath();
- if (iconPath == null){
+ if (iconPath == null) {
// use default Autopsy icon if custom icon is not set
iconPath = "favicon.ico";
}
index.append("