From 53966f3f53f5b179863a695dbe5acf09aaee9a6e Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 16 Jun 2012 13:16:30 +0200 Subject: [PATCH] fix Ox.sanitzeHTML if urls are inside an open a tag --- source/Ox/js/HTML.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/Ox/js/HTML.js b/source/Ox/js/HTML.js index 2c573e15..90330e03 100644 --- a/source/Ox/js/HTML.js +++ b/source/Ox/js/HTML.js @@ -434,6 +434,8 @@ 'foo' > Ox.sanitizeHTML('foo') 'foo' + > Ox.sanitizeHTML('http://www.foo.com/') + 'http://www.foo.com/' > Ox.sanitizeHTML('foo') 'foo' > Ox.sanitizeHTML('foo') @@ -474,10 +476,11 @@ }); }); }); - html = Ox.addLinks(Ox.encodeHTMLEntities(html), true); + html = Ox.encodeHTMLEntities(html); matches.forEach(function(match, i) { html = html.replace(new RegExp(salt.join(i)), match); }); + html = Ox.addLinks(html, true); html = html.replace(/\n\n/g, '

'); // Close extra opening and remove extra closing tags. // Note: this converts ''' to "'" and '"' to '"'