summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-09-30 11:29:31 -0700
committerBrion Vibber <brion@pobox.com>2010-09-30 11:29:31 -0700
commit1acc7d66c63e0b9f794791e3a2e2b0f60bc2ebb1 (patch)
treeaab9121a9d831110e5282fc2a5c9f138a73b27f4 /plugins
parent91f25ca8170fa537a80161ff80190eea55c88b06 (diff)
Always specify UTF-8 targt charset for html_entity_decode(); default is 8-bit ISO-8859-1 which causes things to break when we later pass them through things that expect to work with UTF-8. For instance, running through preg_replace() with the /u option results in NULL, leading to problems with OStatus and SubMirror generating their plaintext versions and doing length-cropping.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/OStatus/classes/Ostatus_profile.php4
-rwxr-xr-xplugins/TwitterBridge/daemons/twitterstatusfetcher.php2
2 files changed, 3 insertions, 3 deletions
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index 047435f66..10cee917e 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -558,7 +558,7 @@ class Ostatus_profile extends Memcached_DataObject
// Get (safe!) HTML and text versions of the content
$rendered = $this->purify($sourceContent);
- $content = html_entity_decode(strip_tags($rendered));
+ $content = html_entity_decode(strip_tags($rendered), ENT_QUOTES, 'UTF-8');
$shortened = common_shorten_links($content);
@@ -569,7 +569,7 @@ class Ostatus_profile extends Memcached_DataObject
if (Notice::contentTooLong($shortened)) {
$attachment = $this->saveHTMLFile($note->title, $rendered);
- $summary = html_entity_decode(strip_tags($note->summary));
+ $summary = html_entity_decode(strip_tags($note->summary), ENT_QUOTES, 'UTF-8');
if (empty($summary)) {
$summary = $content;
}
diff --git a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php
index 590fa2954..cef67b180 100755
--- a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php
+++ b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php
@@ -321,7 +321,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon
$notice->is_local = Notice::GATEWAY;
- $notice->content = html_entity_decode($status->text);
+ $notice->content = html_entity_decode($status->text, ENT_QUOTES, 'UTF-8');
$notice->rendered = $this->linkify($status);
if (Event::handle('StartNoticeSave', array(&$notice))) {