Home > CMS Tutorial > Discuz > How to solve discuz3.4 special character garbled characters

How to solve discuz3.4 special character garbled characters

青灯夜游
Release: 2021-03-16 10:29:03
forward
3218 people have browsed it

下面discuz栏目给大家介绍一下discuz3.4特殊字符乱码的解决方案。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。

How to solve discuz3.4 special character garbled characters

相关推荐:《discuz教程

Discuz!3.4升级后,贴子内容使用Unicode编码会出现直接显示源码问题

打开:source\function\function_core.php

$string = str_replace(array('&', '"', '<&#39;, &#39;>'), array('&', '"', '<&#39;, &#39;>'), $string);
Copy after login

下面加入

if(strpos($string, '&#') !== false) {
                $string = preg_replace('/&((#(\d{3,5}|x[a-fA-F0-9]{4}));)/', '&\\1', $string);
            }
Copy after login

保存文件 覆盖 更新缓存 刷新贴子看看效果

更多编程相关知识,请访问:编程视频!!

The above is the detailed content of How to solve discuz3.4 special character garbled characters. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template