diff --git a/js/bookmarks.js b/js/bookmarks.js index 438b72ac..4be95135 100644 --- a/js/bookmarks.js +++ b/js/bookmarks.js @@ -265,7 +265,7 @@ function updateBookmarksList(bookmark, position) { var taglist = ''; for ( var i=0, len=tags.length; i' + encodeEntities(tags[i]) + ' '; + taglist = taglist + '' + escapeHTML(tags[i]) + ' '; } if(!hasProtocol(bookmark.url)) { bookmark.url = 'http://' + bookmark.url; @@ -312,14 +312,6 @@ function recordClick(event) { }); } -function encodeEntities(s){ - try { - return $('
').text(s).html(); - } catch (ex) { - return ""; - } -} - function hasProtocol(url) { var regexp = /(ftp|http|https|sftp)/; return regexp.test(url); diff --git a/templates/js_tpl.php b/templates/js_tpl.php index 365ca467..75b39a85 100644 --- a/templates/js_tpl.php +++ b/templates/js_tpl.php @@ -7,10 +7,10 @@  

- - <%= encodeEntities(title == '' ? url : title ) %> + + <%= escapeHTML(title == '' ? encodeURI(url) : title ) %> - <%= encodeEntities(description)%> + <%= escapeHTML(description)%> <%= formatDate(added_date) %>

@@ -28,11 +28,11 @@

+ value="<%= escapeHTML(title) %>"/>

+ value="<%= encodeURI(url)%>"/>

    <% for ( var i = 0; i < tags.length; i++ ) { %> @@ -41,7 +41,7 @@

+ ><%= escapeHTML(description) %>