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.'';
  • }
  • }
  • 复制代码