diff options
author | Brion Vibber <brion@pobox.com> | 2010-02-23 21:47:14 +0000 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-02-23 21:47:14 +0000 |
commit | d6ad7332475f1cc4ab45d55fc04ef491d5f3999d (patch) | |
tree | df1913452d0aeb88706f9c660bd99df6399f1c57 /plugins/OStatus/classes | |
parent | 5f9a8ca64bee5247358238c26b4f54003337d11b (diff) |
OStatus: fixes for link/id and text extraction gets import of Buzz feeds working.
Diffstat (limited to 'plugins/OStatus/classes')
-rw-r--r-- | plugins/OStatus/classes/Ostatus_profile.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 91b957fa2..4998809bc 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -556,17 +556,28 @@ class Ostatus_profile extends Memcached_DataObject if ($activity->object->link) { $sourceUrl = $activity->object->link; + } else if ($activity->link) { + $sourceUrl = $activity->link; } else if (preg_match('!^https?://!', $activity->object->id)) { $sourceUrl = $activity->object->id; } - // @fixme sanitize and save HTML content if available + // Get (safe!) HTML and text versions of the content - $content = $activity->object->title; + require_once(INSTALLDIR.'/extlib/HTMLPurifier/HTMLPurifier.auto.php'); + + $html = $activity->object->content; + + $purifier = new HTMLPurifier(); + + $rendered = $purifier->purify($html); + + $content = html_entity_decode(strip_tags($rendered)); $params = array('is_local' => Notice::REMOTE_OMB, 'url' => $sourceUrl, - 'uri' => $sourceUri); + 'uri' => $sourceUri, + 'rendered' => $rendered); $location = $activity->context->location; |