改动一下./include.php中的clearhtmlcode函数
注释中有by wenew是我加的
function clearhtmlcode($text) {
$search = array ("'<script[^>]*?>.*?</script>'si", // Strip out javascript
"'http://.*?.jpg'si", // 替换图片地址 by wenew
"'http://.*?.gif'si", //替换图片地址 by wenew
"'<img.*?>'si", // 替换图片地址 by wenew
"'<[\/\!]*?[^<>]*?>'si", // Strip out html tags
"'([\r\n])[\s]+'", // Strip out white space
"'&(quot|#34);'i", // Replace html entities
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i",
"'&#(\d+);'e"); // evaluate as php
$replace = array ("",
"(图片)", // 替换图片地址 by wenew
"(图片)", // 替换图片地址 by wenew
"(图片)", // 替换图片地址 by wenew
"",
"\\1",
"\"",
"&",
"<",
">",
" ",
chr(161),
chr(162),
chr(163),
chr(169),
"chr(\\1)");
$text = preg_replace ($search, $replace, $text);
$text = str_replace('<', '<', $text);
$text = str_replace('>', '>', $text);
return $text;
}
我在用,可以到我那里交流http://wenew.com.ru/thread.php?fid=60
[ 本帖最后由 wenewnet 于 2006-2-9 12:42 编辑 ] |