]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Throw an exception if we receive a document instead of a feed's root element
authorZach Copley <zach@status.net>
Tue, 16 Mar 2010 02:06:06 +0000 (19:06 -0700)
committerZach Copley <zach@status.net>
Tue, 16 Mar 2010 02:06:06 +0000 (19:06 -0700)
lib/activity.php

index ae65fe36ff9135a5bed7b95529d83009f8872bec..d84eabf7c4ad5d3cfa892195dafceb913c39429c 100644 (file)
@@ -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;