新聞中心
Discuz x3.1論壇內(nèi)容頁面空白的解決方法
今天與大家分享一個Discuz x3.1內(nèi)容頁面空白的問題;無憂小編利用下班時間分析了一下,找到了Discuz x3.1頁面空白的原因,可能是因為php版本兼容性的問題所致,所以只是部分用戶遇到這種情況,這里分享一下。無憂主機香港的php虛擬主機是完美支持discuz!X系列所有版本,不會出現(xiàn)這類低級的兼容性問題。
經(jīng)過分析發(fā)現(xiàn)是../source/function/function_core.php文件中一處代碼的原因:約2043行代碼如下:
static $replacements = array( ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]");
截圖如下:
是因為Discuz X3.1中新增了一個函數(shù)導致部分版本不兼容導致空白,只需要把如下代碼中紅色部分代碼,將其中的雙引號換成單引號即解決問題:
function fixurl($url) {
static $fix = array( '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%25', '%23', '%5B', '%5D');
static $replacements = array( ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]");
return str_replace($fix, $replacements, urlencode($url));
}
修改后的代碼如下:
static $replacements = array( ':', '@', '&', '=', '+', '$', ',', '/', '?', '%', '#', '[', ']');
本文地址:http://m.love62.cn/discuz/13254.html
![1](/wp-content/themes/starow_z/img/o-1.png)
![1](/wp-content/themes/starow_z/img/o-2.png)
![1](/wp-content/themes/starow_z/img/o-3.png)
![1](/wp-content/themes/starow_z/img/o-4.png)
![1](/wp-content/themes/starow_z/img/o-5.png)
![1](/wp-content/themes/starow_z/img/o-6.png)
![1](/wp-content/themes/starow_z/img/o-7.png)