Comparing version 0.1.5 to 0.1.6
@@ -40,3 +40,3 @@ /** | ||
var escapeHTML = function (str) { | ||
return str ? (str + '').replace(/&/g, '&') | ||
return exists(str) ? (str + '').replace(/&/g, '&') | ||
.replace(/</g, '<') | ||
@@ -48,2 +48,6 @@ .replace(/>/g, '>') | ||
var exists = function (obj) { | ||
return typeof obj !== 'undefined' && obj !== null; | ||
}; | ||
var shrinkWrapTemplate = function (str) { | ||
@@ -189,3 +193,3 @@ return str.replace(/^\s+/gm, ''); | ||
var forceStr = function (str) { | ||
str = (typeof str === 'undefined' || str === null) ? '' : str; | ||
str = exists(str) ? str : ''; | ||
@@ -192,0 +196,0 @@ if (options.escapeByDefault && str) { |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"main": "caveman.js", | ||
@@ -10,0 +10,0 @@ "scripts": { |
@@ -527,3 +527,3 @@ | ||
```html | ||
<script>alert("HELLO XSS!");</script> & ' | ||
<script>alert("HELLO!");</script> & ' | ||
``` | ||
@@ -548,3 +548,3 @@ | ||
```html | ||
<script>alert("HELLO XSS!");</script> & ' | ||
<script>alert("HELLO!");</script> & ' | ||
``` | ||
@@ -551,0 +551,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48723
361