Regarding the problem that Chinese characters are not displayed when phpcms content is modified

WBOY
Release: 2016-07-29 09:09:45
Original
948 people have browsed it

Original URL: http://www.111cn.net/wy/CMS/87635.htm

The gbk version of phpcms2008sp4 found that the title, content, etc. were not displayed when editing articles in the background, as shown below:

Regarding the problem that Chinese characters are not displayed when phpcms content is modified

After investigation It was found that the problem with the htmlspecialchars parameter used by phpcms2008sp4 when processing article information resulted in the loss of Chinese characters (the parameters need to be completed in the php5.4/5.5 version). Directly using htmlspecialchars($data[$field], ENT_QUOTES) returns a null value without any processing.

Solution:

Look in datacache_modelcontent_form.class.php

$value = isset($data[$field]) ? htmlspecialchars($data[$field], ENT_QUOTES) : '';

Change to:

$value = isset($data[$field]) ? htmlspecialchars($data[$field], ENT_QUOTES,'GB2312') : '';


The above introduces the problem of not displaying Chinese characters when modifying the content of phpcms, including the content of GB2312. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
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