* Fix WBXML encoding issue (community bug#3020)

This commit is contained in:
Jörg Lehrke 2011-10-04 21:21:38 +00:00
parent 23584253fd
commit b65428b153
2 changed files with 5 additions and 2 deletions

View File

@ -48,7 +48,7 @@ class Horde_SyncML_Command_Sync_ContentSyncElement extends Horde_SyncML_Command_
case 'strictxml': case 'strictxml':
break; break;
case 'htmlenc': case 'htmlenc':
if ($this->_contentSize) { if (!$state->isWBXML() && $this->_contentSize) {
$this->_content = htmlspecialchars($this->_content, ENT_COMPAT, 'UTF-8'); $this->_content = htmlspecialchars($this->_content, ENT_COMPAT, 'UTF-8');
} }
break; break;
@ -138,7 +138,9 @@ class Horde_SyncML_Command_Sync_ContentSyncElement extends Horde_SyncML_Command_
} }
switch ($contentFormat) { switch ($contentFormat) {
case 'strictxml': case 'strictxml':
$chars = '<![CDATA['. $chars. ']]>'; if (!$state->isWBXML()) {
$chars = '<![CDATA['. $chars. ']]>';
}
break; break;
} }
$output->characters($chars); $output->characters($chars);

View File

@ -860,6 +860,7 @@ class Horde_SyncML_State {
$res['ContentFormat'] = 'htmlenc'; $res['ContentFormat'] = 'htmlenc';
default: default:
$res['mayFragment'] = 1; $res['mayFragment'] = 1;
$res['ContentFormat'] = 'strictxml';
break; break;
} }