Background
This issue is part of a project (#1004) to migrate inline TODOs to GitHub issues. If this issue is still relevant, please assign milestone(s) and team member(s) accordingly.
On acceptance as a valid issue, the code should be annotated with a comment pointing back to this issue.
On completion of the issue, the code should be updated to remove the comment and the pointer to the issue.
TODOs and surrounding code
https://github.com/textpattern/textpattern/blob/dev/rpc/TXP_RPCServer.php#L241
https://github.com/textpattern/textpattern/blob/dev/rpc/TXP_RPCServer.php#L250
switch ($encoding) {
case 'utf-8':
$data = $HTTP_RAW_POST_DATA;
break;
case 'iso-8859-1':
// TODO: if utf8 conversion fails, throw: 32701 ---> parse error. unsupported encoding?
// see: http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php
// This will fail on parser if utf8_encode is unavailiable.
$data = (function_exists('utf8_encode') && is_callable('utf8_encode'))
? utf8_encode($HTTP_RAW_POST_DATA)
: $HTTP_RAW_POST_DATA;
break;
default:
// TODO: if utf8 conversion fails, throw: 32701 ---> parse error. unsupported encoding?
// This will fail on parser if mb_convert_encoding is unavailiable.
$data = (function_exists('mb_convert_encoding') && is_callable('mb_convert_encoding'))
? mb_convert_encoding($HTTP_RAW_POST_DATA, 'utf-8', $encoding)
: $HTTP_RAW_POST_DATA;
break;
}
}
$this->message = new IXR_Message($data);
if (!$this->message->parse()) {
$this->error(-32700, 'parse error. not well formed');
}
Background
This issue is part of a project (#1004) to migrate inline TODOs to GitHub issues. If this issue is still relevant, please assign milestone(s) and team member(s) accordingly.
On acceptance as a valid issue, the code should be annotated with a comment pointing back to this issue.
On completion of the issue, the code should be updated to remove the comment and the pointer to the issue.
TODOs and surrounding code
https://github.com/textpattern/textpattern/blob/dev/rpc/TXP_RPCServer.php#L241
https://github.com/textpattern/textpattern/blob/dev/rpc/TXP_RPCServer.php#L250