allthebest 發表於 2019-7-25 06:26:51

discuz! X3.4特殊字符乱码解决方案!

Discuz! X3.4升级后,帖子内容使用Unicode编码会出现直接显示源码问题<br /><br /><br />打开:source\function\function_core.php<br /><br /><ol><li>$string = str_replace(array('&amp;', '&quot;', '&lt;', '&gt;'), array('&amp;', '&quot;', '&lt;', '&gt;'), $string);</ol><br /><br />下面加入<br /><br /><ol><li>if(strpos($string, '&amp;#') !== false) {<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; $string = preg_replace('/&amp;((#(\d{3,5}|x{4}));)/', '&amp;\\1', $string);<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}</ol><br /><br />保存文件&nbsp;&nbsp;更新缓存 刷新帖子 看看效果X3<em>, </em>帖子<em>, </em>function<em>, </em>Discuz<em>, </em>升级

耗子 發表於 2019-7-25 19:24:38

感谢分享

xilushequ 發表於 2019-7-25 19:26:02

发发发发发发发发

maqingxi 發表於 2019-7-30 12:48:08

我添加后,网站无法打开,删除后又正常了。

maqingxi 發表於 2019-7-30 13:05:50

原来论坛上有位网友说已经解决,但他的教程上没有说明修改哪个文件。<br />他的帖子:http://www.discuz.net/thread-3842097-1-1.html<br />

allthebest 發表於 2019-7-30 18:51:07

<br />添加后,没理由网站无法打开。<br /><br />你的网站 以前的模版修改、插件、第三方模版等等或许有问题。<br /><br />后台--文件校验--查看 有否文件要修复问题吧?

maqingxi 發表於 2019-7-31 17:46:46

<br />被修改文件: 1753&nbsp; &nbsp;丢失文件: 0&nbsp; &nbsp;未知文件: 26&nbsp; &nbsp;一周内更新: 1&nbsp; &nbsp;最后校验时间: 刚刚

allthebest 發表於 2019-8-3 15:46:00

<br />不清楚你的修改文件: 1753 有什么?<br /><br />未知文件 有什么?<br /><br />我刚测试下 打不开与本帖代码无关

一苇过江 發表於 2019-8-3 16:49:48

<br />说是加了会降低安全系数,不知道影响会不会很大。
頁: [1]
查看完整版本: discuz! X3.4特殊字符乱码解决方案!