Encode non-BMP UTF-8 characters as HTML entities

This commit is contained in:
Kijin Sung 2016-01-17 14:09:45 +09:00
parent 7d44db1dcb
commit d474c20a36
4 changed files with 31 additions and 2 deletions

View file

@ -310,6 +310,10 @@ class documentController extends document
// An error appears if both log-in info and user name don't exist.
if(!$logged_info->member_srl && !$obj->nick_name) return new Object(-1,'msg_invalid_request');
// Fix encoding of non-BMP UTF-8 characters.
$obj->title = utf8_mbencode($obj->title);
$obj->content = utf8_mbencode($obj->content);
$obj->lang_code = Context::getLangType();
// Insert data into the DB
if(!$obj->status) $this->_checkDocumentStatusForOldVersion($obj);
@ -552,6 +556,10 @@ class documentController extends document
// if temporary document, regdate is now setting
if($source_obj->get('status') == $this->getConfigStatus('temp')) $obj->regdate = date('YmdHis');
// Fix encoding of non-BMP UTF-8 characters.
$obj->title = utf8_mbencode($obj->title);
$obj->content = utf8_mbencode($obj->content);
// Insert data into the DB
$output = executeQuery('document.updateDocument', $obj);
if(!$output->toBool())