summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-03-15 19:06:06 -0700
committerZach Copley <zach@status.net>2010-03-15 19:06:06 -0700
commitb994d529f4de53df6350e12b5e81889cee17f317 (patch)
tree1fb041b9e7808999a2e2ce2df72e031833932c81
parentd1ea448c274334cfee49c8d53e61866145084433 (diff)
Throw an exception if we receive a document instead of a feed's root element
-rw-r--r--lib/activity.php10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/activity.php b/lib/activity.php
index ae65fe36f..d84eabf7c 100644
--- a/lib/activity.php
+++ b/lib/activity.php
@@ -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;