修正合并错误问题

This commit is contained in:
Zongmin Lei
2013-11-05 18:16:02 +08:00
parent 629f31b697
commit 9538e5063c

View File

@@ -300,6 +300,7 @@ FilterXSS.prototype.process = function (html) {
var tagStart = false;
var quoteStart = false;
var currentPos = 0;
var len = 0;
// 逐个分析字符
for (currentPos = 0, len = html.length; currentPos < len; currentPos++) {
@@ -377,12 +378,12 @@ if (typeof window !== 'undefined') {
}
if(!Array.forEach){
Array.prototype.forEach = function(fn){
for(var i=0;i<this.length;i++) fn(this[i],i,this);
for(var i=0;i<this.length;i++) fn(this[i],i,this);
};
}
if(!String.trim){
String.prototype.trim = function(){
return this.replace(/(^\s*)|(\s*$)/g,"");
return this.replace(/(^\s*)|(\s*$)/g,"");
};
}
window.filterXSS = module.exports;