]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/activity.php
Merge branch 'testing' into 0.9.x
[quix0rs-gnu-social.git] / lib / activity.php
index 6acf37a8a20e4986362cf1871e35489fa23f7a16..d84eabf7c4ad5d3cfa892195dafceb913c39429c 100644 (file)
@@ -463,7 +463,7 @@ class ActivityUtils
                 $text = $contentEl->textContent;
                 return htmlspecialchars_decode($text, ENT_QUOTES);
             } else if ($type == 'xhtml') {
-                $divEl = ActivityUtils::child($contentEl, 'div');
+                $divEl = ActivityUtils::child($contentEl, 'div', 'http://www.w3.org/1999/xhtml');
                 if (empty($divEl)) {
                     return null;
                 }
@@ -1083,15 +1083,11 @@ class Activity
 
         $this->entry = $entry;
 
-        // @fixme Don't send in a DOMDocument
+        // Insist on a feed's root DOMElement; don't allow a DOMDocument
         if ($feed instanceof DOMDocument) {
-            common_log(
-                LOG_WARNING,
-                'Activity::__construct() - '
-                . 'DOMDocument passed in for feed by mistake. '
-                . "Expecting a 'feed' DOMElement."
+            throw new ClientException(
+                _("Expecting a root feed element but got a whole XML document.")
             );
-            $feed = $feed->getElementsByTagName('feed')->item(0);
         }
 
         $this->feed  = $feed;