Fix because qvitter supplies a twitter array value which is an array

works for json API, not for XML, so we make an exception here...
This commit is contained in:
Mikael Nordfeldth 2016-01-02 02:01:54 +01:00
parent cf6e06a5dd
commit fe328ae5e4
1 changed files with 5 additions and 0 deletions

View File

@ -651,6 +651,11 @@ class ApiAction extends Action
break;
default:
if (strncmp($element, 'statusnet_', 10) == 0) {
if ($element === 'statusnet_in_groups' && is_array($value)) {
// QVITTERFIX because it would cause an array to be sent as $value
// THIS IS UNDOCUMENTED AND SHOULD NEVER BE RELIED UPON (qvitter uses json output)
$value = json_encode($value);
}
$this->element('statusnet:'.substr($element, 10), null, $value);
} else {
$this->element($element, null, $value);