filterhtml
Advanced tools
Comparing version 0.3.4 to 0.3.5
@@ -785,4 +785,11 @@ var FilterHTML = (function() { | ||
HTMLFilter.prototype.purify_url = function(url) { | ||
var parts, scheme, allowed_scheme; | ||
var parts, scheme, allowed_scheme, escape_char; | ||
// strip out all encoded tag characters | ||
for (escape_char in HTML_ESCAPE_CHARS) { | ||
if (HTML_ESCAPE_CHARS.hasOwnProperty(escape_char)) { | ||
url = url.replace(HTML_ESCAPE_CHARS[escape_char], ''); | ||
} | ||
} | ||
if (this.allowed_schemes.indexOf('//') < 0 && url.charAt(0) === '/' && url.charAt(1) === '/') { | ||
@@ -789,0 +796,0 @@ return '#'; // disallow protocol-relative URLs (possible XSS vector) |
@@ -5,3 +5,3 @@ { | ||
"description": "FilterHTML: A whitelisting HTML filter for Python and JavaScript", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "url": "https://github.com/dcollien/FilterHTML" |
36910
1020