mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-03 09:14:48 +09:00
Fix #1853 encode non-BMP characters in multilang document title and content
This commit is contained in:
parent
23f7568e74
commit
5a95f0c3f3
1 changed files with 15 additions and 4 deletions
|
|
@ -938,8 +938,16 @@ class documentController extends document
|
||||||
if($source_obj->get('status') == $this->getConfigStatus('temp')) $obj->regdate = date('YmdHis');
|
if($source_obj->get('status') == $this->getConfigStatus('temp')) $obj->regdate = date('YmdHis');
|
||||||
|
|
||||||
// Fix encoding of non-BMP UTF-8 characters.
|
// Fix encoding of non-BMP UTF-8 characters.
|
||||||
$obj->title = utf8_mbencode($obj->title);
|
if (isset($extra_content))
|
||||||
$obj->content = utf8_mbencode($obj->content);
|
{
|
||||||
|
$extra_content->title = utf8_mbencode($extra_content->title);
|
||||||
|
$extra_content->content = utf8_mbencode($extra_content->content);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$obj->title = utf8_mbencode($obj->title);
|
||||||
|
$obj->content = utf8_mbencode($obj->content);
|
||||||
|
}
|
||||||
|
|
||||||
// Insert data into the DB
|
// Insert data into the DB
|
||||||
$output = executeQuery('document.updateDocument', $obj);
|
$output = executeQuery('document.updateDocument', $obj);
|
||||||
|
|
@ -977,8 +985,11 @@ class documentController extends document
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inert extra vars for multi-language support of title and contents.
|
// Inert extra vars for multi-language support of title and contents.
|
||||||
if($extra_content->title) $this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, -1, $extra_content->title, 'title_'.Context::getLangType());
|
if (isset($extra_content))
|
||||||
if($extra_content->content) $this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, -2, $extra_content->content, 'content_'.Context::getLangType());
|
{
|
||||||
|
$this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, -1, $extra_content->title, 'title_'.Context::getLangType());
|
||||||
|
$this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, -2, $extra_content->content, 'content_'.Context::getLangType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the category if the category_srl exists.
|
// Update the category if the category_srl exists.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue