[Pkg-javascript-commits] [backbone] 88/211: Fixed escapeHTML function to skip not only &***; , but also &#***; and &x***;
Jonas Smedegaard
js at moszumanska.debian.org
Sat May 3 17:00:06 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag 0.5.0
in repository backbone.
commit 0cdc525961d3fa98e810ffae6bcc8e3838e36d93
Author: Dmitry Baranovskiy <Dmitry at Baranovskiy.com>
Date: Wed Mar 2 08:12:24 2011 +1100
Fixed escapeHTML function
to skip not only &***;, but also &#***; and &x***;
---
backbone.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backbone.js b/backbone.js
index 98ba0dd..47e85ae 100644
--- a/backbone.js
+++ b/backbone.js
@@ -1079,7 +1079,7 @@
// Helper function to escape a string for HTML rendering.
var escapeHTML = function(string) {
- return string.replace(/&(?!\w+;)/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
+ return string.replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
};
}).call(this);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git
More information about the Pkg-javascript-commits
mailing list