discuz 6正文反隐藏黑链办法
10714
- Kokgog2011-11-08论坛元老8518
include/discuzcode.func.php- - function parseurl($url, $text) {
- if(!$url && preg_match("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast){1}:\/\/|www\.)[^\["']+/i", trim($text), $matches)) {
- $url = $matches[0];
- $length = 65;
- if(strlen($url) > $length) {
- $text = substr($url, 0, intval($length 0.5)).' ... '.substr($url, - intval($length 0.3));
- }
- return ''.$text.'';
- } else {
- $url = substr($url, 1);
- if(substr(strtolower($url), 0, 4) == 'www.') {
- $url = 'http://'.$url;
- }
- return ''.$text.'';
- }
- }
- 复制代码改成- - function parseurl($url, $text) {
- if(!$url && preg_match("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast){1}:\/\/|www\.)[^\["']+/i", trim($text), $matches)) {
- $url = $matches[0];
- $length = 65;
- if(strlen($url) > $length) {
- $text = substr($url, 0, intval($length 0.5)).' ... '.substr($url, - intval($length 0.3));
- }
- return ''.$text.'';
- } else {
- $url = substr($url, 1);
- if(substr(strtolower($url), 0, 4) == 'www.') {
- $url = 'http://'.$url;
- }
- return ''.$text.'';
- }
- }
- 复制代码