summaryrefslogtreecommitdiff
path: root/lib/activity.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/activity.php')
-rw-r--r--lib/activity.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/activity.php b/lib/activity.php
index d84eabf7c..23cf50f70 100644
--- a/lib/activity.php
+++ b/lib/activity.php
@@ -458,11 +458,14 @@ class ActivityUtils
// slavishly following http://atompub.org/rfc4287.html#rfc.section.4.1.3.3
if (empty($type) || $type == 'text') {
- return $contentEl->textContent;
+ // Plain text source -- let's turn it into HTML!
+ return htmlspecialchars($contentEl->textContent);
} else if ($type == 'html') {
- $text = $contentEl->textContent;
- return htmlspecialchars_decode($text, ENT_QUOTES);
+ // The XML text decoding gives us an HTML string ready to roll.
+ return $contentEl->textContent;
} else if ($type == 'xhtml') {
+ // Embedded XHTML; we have to pull it out of the document tree,
+ // then serialize it back out to an HTML fragment string.
$divEl = ActivityUtils::child($contentEl, 'div', 'http://www.w3.org/1999/xhtml');
if (empty($divEl)) {
return null;
@@ -720,7 +723,7 @@ class ActivityObject
}
}
- static function fromNotice($notice)
+ static function fromNotice(Notice $notice)
{
$object = new ActivityObject();
@@ -734,7 +737,7 @@ class ActivityObject
return $object;
}
- static function fromProfile($profile)
+ static function fromProfile(Profile $profile)
{
$object = new ActivityObject();