Dedecms add an article when the tip title is empty, edit the article editor Blank Solution

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.