We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 802734d0 authored by mattl's avatar mattl

Switch order of html/text for StatusNet backwards compatibility

StatusNet chooses the first content element in an Atom feed, while
it should really choose the 'html' representation for its 'rendered'
and 'text' representation for the (text-only) 'content'.

GNU social will implement a better algorithm for retrieving Atom
feeds, but that is yet to be done. So to avoid having link-less posts
on remote nodes, we'll just do the old switch-a-roo.

Other Atom readers, such as Mozilla Firefox, has the reverse priority
(choosing the last of the content elements).
parent 03987419
...@@ -698,13 +698,13 @@ class ActivityObject ...@@ -698,13 +698,13 @@ class ActivityObject
// XXX: assuming HTML content here // XXX: assuming HTML content here
$xo->element( $xo->element(
ActivityUtils::CONTENT, ActivityUtils::CONTENT,
array('type' => 'text'), array('type' => 'html'),
html_entity_decode(strip_tags($this->content), ENT_QUOTES, 'UTF-8') common_xml_safe_str($this->content)
); );
$xo->element( $xo->element(
ActivityUtils::CONTENT, ActivityUtils::CONTENT,
array('type' => 'html'), array('type' => 'text'),
common_xml_safe_str($this->content) html_entity_decode(strip_tags($this->content), ENT_QUOTES, 'UTF-8')
); );
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment