aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-06-28 19:34:49 -0700
committerzotlabs <mike@macgirvin.com>2017-06-28 19:34:49 -0700
commit126af3a24a0dffc705235ed083a9192f97749829 (patch)
tree979f17d91681f4134724352e04a5f4ea6124a3a2
parentb91d95d2418237f4344fa0906dd47815e20de2e9 (diff)
downloadvolse-hubzilla-126af3a24a0dffc705235ed083a9192f97749829.tar.gz
volse-hubzilla-126af3a24a0dffc705235ed083a9192f97749829.tar.bz2
volse-hubzilla-126af3a24a0dffc705235ed083a9192f97749829.zip
pretend it's a real feed even though it isn't
-rw-r--r--include/feedutils.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/feedutils.php b/include/feedutils.php
index 937a2d28c..184f8ed09 100644
--- a/include/feedutils.php
+++ b/include/feedutils.php
@@ -1249,9 +1249,19 @@ function feed_conversation_fetch($importer,$contact,$parent_link) {
if(! $fetch['success'])
return false;
+ $data = $fetch['body'];
- consume_feed($fetch['body'],$importer,$contact,1);
- consume_feed($fetch['body'],$importer,$contact,2);
+ // We will probably receive an atom 'entry' and not an atom 'feed'. Unfortunately
+ // our parser is a bit strict about compliance so we'll insert just enough of a feed
+ // tag to trick it into believing it's a compliant feed.
+
+ if(! strstr($data,'<feed')) {
+ $data = str_replace('<entry ','<feed xmlns="http://www.w3.org/2005/Atom"><entry ',$data);
+ $data .= '</feed>';
+ }
+
+ consume_feed($data,$importer,$contact,1);
+ consume_feed($data,$importer,$contact,2);
}