Note._toHtmlEntity move to common.js

This commit is contained in:
life
2015-03-31 17:04:22 +08:00
parent ab0ee68f39
commit bb65ef992a
9 changed files with 23 additions and 22 deletions

View File

@ -1278,6 +1278,10 @@ function setHash(key, value) {
location.href = "#" + str;
}
var trimTitle = function(title) {
// 防止js注入
function trimTitle(title) {
return title.replace(/<.*?script.*?>/g, '');
};
function toHtmlEntity(html) {
return (html + '').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
};