PHP
·
发表于 5年以前
·
阅读量:8296
function evalscript(s) {
if (s.indexOf("<script") == -1) return s;
var p = /<script[^\>]*?>([^\x00]*?)<\/script>/gi;
var arr = [];
while ((arr = p.exec(s))) {
var p1 = /<script[^\>]*?src=\"([^\>]*?)\"[^\>]*?(reload=\"1\")?(?:charset=\"([\w\-]+?)\")?><\/script>/i;
var arr1 = [];
arr1 = p1.exec(arr[0]);
if (arr1) {
appendscript(arr1[1], "", arr1[2], arr1[3]);
} else {
p1 = /<script(.*?)>([^\x00]+?)<\/script>/i;
arr1 = p1.exec(arr[0]);
appendscript("", arr1[2], arr1[1].indexOf("reload=") != -1);
}
}
return s;
}