summaryrefslogtreecommitdiff
path: root/lib/twitterapi.php
diff options
context:
space:
mode:
authorzach <zach@controlyourself.ca>2008-11-04 03:40:27 -0500
committerzach <zach@controlyourself.ca>2008-11-04 03:40:27 -0500
commite0c3bf5a75094937315aa09dd9635833f9eb2925 (patch)
treeadf16114472da53b4a5dcad854ff81bf366c1226 /lib/twitterapi.php
parent485247e9011e08a6ff0b9a2ff3d7a60bad515a26 (diff)
Better UTF-8 escaped entity handling. Fixed bad chars in all RSS feeds.
darcs-hash:20081104084027-462f3-ea7ab93938358bf90a1c1851d6f665973beae767.gz
Diffstat (limited to 'lib/twitterapi.php')
-rw-r--r--lib/twitterapi.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/twitterapi.php b/lib/twitterapi.php
index d4b6fff4f..378716eaa 100644
--- a/lib/twitterapi.php
+++ b/lib/twitterapi.php
@@ -60,7 +60,7 @@ class TwitterapiAction extends Action {
$profile = $notice->getProfile();
$twitter_status = array();
- $twitter_status['text'] = $notice->content;
+ $twitter_status['text'] = common_xml_safe_str($notice->content);
$twitter_status['truncated'] = 'false'; # Not possible on Laconica
$twitter_status['created_at'] = $this->date_twitter($notice->created);
$twitter_status['in_reply_to_status_id'] = ($notice->reply_to) ? intval($notice->reply_to) : NULL;
@@ -91,8 +91,8 @@ class TwitterapiAction extends Action {
$server = common_config('site', 'server');
$entry = array();
-
- $entry['content'] = $profile->nickname . ': ' . $notice->content;
+
+ $entry['content'] = $profile->nickname . ': ' . common_xml_safe_str($notice->content);
$entry['title'] = $entry['content'];
$entry['link'] = common_local_url('shownotice', array('notice' => $notice->id));
$entry['published'] = common_date_iso8601($notice->created);
@@ -115,14 +115,14 @@ class TwitterapiAction extends Action {
$entry['title'] = sprintf('Message from %s to %s',
$message->getFrom()->nickname, $message->getTo()->nickname);
- $entry['content'] = $message->content;
+ $entry['content'] = common_xml_safe_str($message->content);
$entry['link'] = $message->uri;
$entry['published'] = common_date_iso8601($message->created);
$entry['id'] = "tag:$server,2008:$entry[link]";
$entry['updated'] = $entry['published'];
# RSS Item specific
- $entry['description'] = $message->content;
+ $entry['description'] = $entry['content'];
$entry['pubDate'] = common_date_rfc2822($message->created);
$entry['guid'] = $entry['link'];
@@ -137,8 +137,8 @@ class TwitterapiAction extends Action {
$to_profile = $message->getTo();
$twitter_dm['id'] = $message->id;
- $twitter_dm['sender_id'] = $message->from_profile;
- $twitter_dm['text'] = $message->content;
+ $twitter_dm['sender_id'] = $message->from_profile;
+ $twitter_dm['text'] = common_xml_safe_str($message->content);
$twitter_dm['recipient_id'] = $message->to_profile;
$twitter_dm['created_at'] = $this->date_twitter($message->created);
$twitter_dm['sender_screen_name'] = $from_profile->nickname;
@@ -569,5 +569,5 @@ class TwitterapiAction extends Action {
}
return $source_name;
}
-
+
} \ No newline at end of file