Dedecms version: GBK 5.7 (source of all evils, do not recommend using a GBK or GB2312 encoded) text editor: CKEditor (dedecms default)
Original Configuration environment: Window + IIS + PHP 5.3.28
New configuration environment: Linux + nginx + PHP 5.5.30
PHP htmlspecialchars Update Log
5.6.0 the default value for the encoding parameter is changed to be the value of the Default_charset configuration option .
5.4.0The default value for the encoding parameter is changed to UTF-8.
5.4.0The Constants Ent_substitute, ent_disallowed, ent_html401, ENT_XML1, ent_xhtml and ENT_HTML5 were added.
5.3.0THE constant Ent_ignore was added.
5.2.3The Double_encode parameter was Adde
This problem does not have much to do with the DEDECMS code itself, primarily because PHP 5.4 encodes the default UTF-8 after the Htmlspecialchars function number character. GBK encoded string after the Htmlspecialchars character escape after the Chinese string is empty, so that the title is empty when adding an article, edit the article editor blank. This problem does not occur with the Dedecms UTF-8 version, so it is recommended that you use the UTF-8 version.
Workaround:
1. Tip title is empty
Modify dede/article_add.php and dede/article_edit.php
$title Htmlspecialchars (CN_SUBSTRR ($title,$cfg _title_maxlen));
Replace:
$title Htmlspecialchars (CN_SUBSTRR ($title,$cfg _title_maxlen), Ent_compat, ' GB2312 ');
2. Editor content blank
Modify include/ckeditor/ckeditor_php5.php
$out $name $attr Htmlspecialchars ($value). "</textarea>\n";
Replace:
$out $name $attr Htmlspecialchars ($value, Ent_compat, ' GB2312 '). "</textarea>\n";
Dedecms add an article when the tip title is empty, edit the article editor Blank Solution