编译之前修改的

This commit is contained in:
lealife
2015-05-07 00:13:04 +08:00
parent 1fd6610fa3
commit 12ea17e89f
6 changed files with 11 additions and 5 deletions

View File

@ -1280,8 +1280,14 @@ function setHash(key, value) {
// 防止js注入
function trimTitle(title) {
if(!title) {
return '';
}
return title.replace(/<.*?script.*?>/g, '');
};
function toHtmlEntity(html) {
if(!html) {
return '';
}
return (html + '').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
};