php5.4及以上版本會有此問題
解決辦法:
1. 找到 uc_client/lib/uccode.class.php 文件
2.將 $message = htmlspecialchars($message); 替換為 $message = dhtmlspecialchars($message);
關(guān)于dhtmlspecialchars 是 discuz自定義的將字符轉(zhuǎn)化為Html實體的函數(shù),對php版本做了兼容
- function dhtmlspecialchars($string, $flags = null) {
- if(is_array($string)) {
- foreach($string as $key => $val) {
- $string[$key] = dhtmlspecialchars($val, $flags);
- }
- } else {
- if($flags === null) {
- $string = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string);
- if(strpos($string, '&#') !== false) {
- //過濾掉類似志的16進制的html字符
- $string = preg_replace('/&((#(\d{3,5}|x[a-fA-F0-9]{4}));)/', '&\\1', $string);
- }
- } else {
- if(PHP_VERSION < '5.4.0') {
- $string = htmlspecialchars($string, $flags);
- } else {
- if(strtolower(CHARSET) == 'utf-8') {
- $charset = 'UTF-8';
- } else {
- $charset = 'ISO-8859-1';
- }
- $string = htmlspecialchars($string, $flags, $charset);
- }
- }
- }
- return $string;
- }
復(fù)制代碼
|