]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
* wrong param order to in_array
authorJames Walker <walkah@walkah.net>
Sat, 13 Mar 2010 15:37:08 +0000 (10:37 -0500)
committerJames Walker <walkah@walkah.net>
Sat, 13 Mar 2010 15:37:08 +0000 (10:37 -0500)
* in getContent() if "type" isn't set, assume text (per atom spec)

lib/activity.php

index 125d391b04f89b986b115f674acee9f8e9791167..738200c0bfd4af563b6b9edc7fe025b38f190562 100644 (file)
@@ -457,7 +457,7 @@ class ActivityUtils
 
             // slavishly following http://atompub.org/rfc4287.html#rfc.section.4.1.3.3
 
-            if ($type == 'text') {
+            if (empty($type) || $type == 'text') {
                 return $contentEl->textContent;
             } else if ($type == 'html') {
                 $text = $contentEl->textContent;
@@ -476,7 +476,7 @@ class ActivityUtils
                     $text .= $doc->saveXML($child);
                 }
                 return trim($text);
-            } else if (in_array(array('text/xml', 'application/xml'), $type) ||
+            } else if (in_array($type, array('text/xml', 'application/xml')) ||
                        preg_match('#(+|/)xml$#', $type)) {
                 throw new ClientException(_("Can't handle embedded XML content yet."));
             } else if (strncasecmp($type, 'text/', 5)) {