]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix because qvitter supplies a twitter array value which is an array
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 2 Jan 2016 01:01:54 +0000 (02:01 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 2 Jan 2016 01:01:54 +0000 (02:01 +0100)
works for json API, not for XML, so we make an exception here...

lib/apiaction.php

index 155d91ca7b3953072e6c7f80bffc0b0333340be2..9a574008aacf7bf9474c74d29f546061935d85f2 100644 (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);