修改discuzcode.func.php中discuzcode方法,
修改最后一行的return $htmlon || $allowhtml ? $message : nl2br(str_replace(array("\t", ' ', ' '), array(' ', ' ', ' '), $message));
為
$tempstr= $htmlon || $allowhtml ? $message : nl2br(str_replace(array("\t", ' ', ' '), array(' ', ' ', ' '), $message));
$tempstr= str_replace(" "," ",$tempstr);//code標簽在粘貼一些代碼的時候會把一些空格替換成" "從而出現亂碼,這是暫時性的解決策略,不嚴謹,不過一般沒問題 by 楊中科
return $tempstr;