diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java index 8fbac5d23..05b68be17 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java @@ -106,16 +106,26 @@ public class Dependency implements Comparable { /** * Returns the file name of the dependency. * - * @return the file name of the dependency. + * @return the file name of the dependency */ public String getFileName() { return this.fileName; } + /** + * Returns the file name of the dependency with the backslash escaped for use in JavaScript. This is a complete hack + * as I could not get the replace to work in the template itself. + * + * @return the file name of the dependency with the backslash escaped for use in JavaScript + */ + public String getFileNameForJavaScript() { + return this.fileName.replace("\\", "\\\\"); + } + /** * Sets the file name of the dependency. * - * @param fileName the file name of the dependency. + * @param fileName the file name of the dependency */ public void setFileName(String fileName) { this.fileName = fileName; @@ -124,7 +134,7 @@ public class Dependency implements Comparable { /** * Sets the actual file path of the dependency on disk. * - * @param actualFilePath the file path of the dependency. + * @param actualFilePath the file path of the dependency */ public void setActualFilePath(String actualFilePath) { this.actualFilePath = actualFilePath; @@ -137,7 +147,7 @@ public class Dependency implements Comparable { /** * Gets the file path of the dependency. * - * @return the file path of the dependency. + * @return the file path of the dependency */ public String getActualFilePath() { return this.actualFilePath; @@ -146,7 +156,7 @@ public class Dependency implements Comparable { /** * Gets a reference to the File object. * - * @return the File object. + * @return the File object */ public File getActualFile() { return new File(this.actualFilePath); @@ -155,7 +165,7 @@ public class Dependency implements Comparable { /** * Sets the file path of the dependency. * - * @param filePath the file path of the dependency. + * @param filePath the file path of the dependency */ public void setFilePath(String filePath) { this.filePath = filePath; @@ -168,7 +178,7 @@ public class Dependency implements Comparable { * NOTE: This may not be the actual path of the file on disk. The actual path of the file on disk can be * obtained via the getActualFilePath().

* - * @return the file path of the dependency. + * @return the file path of the dependency */ public String getFilePath() { return this.filePath; @@ -177,7 +187,7 @@ public class Dependency implements Comparable { /** * Sets the file name of the dependency. * - * @param fileExtension the file name of the dependency. + * @param fileExtension the file name of the dependency */ public void setFileExtension(String fileExtension) { this.fileExtension = fileExtension; @@ -186,7 +196,7 @@ public class Dependency implements Comparable { /** * Gets the file extension of the dependency. * - * @return the file extension of the dependency. + * @return the file extension of the dependency */ public String getFileExtension() { return this.fileExtension; @@ -231,7 +241,7 @@ public class Dependency implements Comparable { /** * Returns a List of Identifiers. * - * @return an ArrayList of Identifiers. + * @return an ArrayList of Identifiers */ public Set getIdentifiers() { return this.identifiers; @@ -240,7 +250,7 @@ public class Dependency implements Comparable { /** * Sets a List of Identifiers. * - * @param identifiers A list of Identifiers. + * @param identifiers A list of Identifiers */ public void setIdentifiers(Set identifiers) { this.identifiers = identifiers; diff --git a/dependency-check-core/src/main/resources/templates/HtmlReport.vsl b/dependency-check-core/src/main/resources/templates/HtmlReport.vsl index c80c7b4e4..13bd18d4d 100644 --- a/dependency-check-core/src/main/resources/templates/HtmlReport.vsl +++ b/dependency-check-core/src/main/resources/templates/HtmlReport.vsl @@ -586,7 +586,7 @@ Copyright (c) 2012 Jeremy Long. All Rights Reserved. #end #if ($id.type=="cpe") ##yes, we are HTML Encoding into JavaScript... the escape utils don't have a JS Encode and I haven't written one yet -    +    #end #if ($id.description)
$esc.html($id.description) @@ -602,7 +602,7 @@ Copyright (c) 2012 Jeremy Long. All Rights Reserved.
#foreach($vuln in $dependency.getVulnerabilities()) #set($vsctr=$vsctr+1) -

$esc.html($vuln.name)  

+

$esc.html($vuln.name)  

Severity: #if ($vuln.cvssScore<4.0) Low