summaryrefslogtreecommitdiff
path: root/scripts/xmppdaemon.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-12-13 19:22:39 -0500
committerEvan Prodromou <evan@prodromou.name>2008-12-13 19:22:39 -0500
commitaa4fb6b71e552e00f8ca83aded7bf39539f8b456 (patch)
treebb58e1c9eb3e9c2b545b13556c8d0f7478e72bdf /scripts/xmppdaemon.php
parentfe932da97134b458f37e2ad13ce484485c56b0db (diff)
trim the body of an incoming message
darcs-hash:20081214002239-84dde-9d4d15f37b48ed1830c0423e7e34cb11c7cf9c2d.gz
Diffstat (limited to 'scripts/xmppdaemon.php')
-rwxr-xr-xscripts/xmppdaemon.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php
index f460ec6e1..9a60970a6 100755
--- a/scripts/xmppdaemon.php
+++ b/scripts/xmppdaemon.php
@@ -236,13 +236,14 @@ class XMPPDaemon extends Daemon {
}
function add_notice(&$user, &$pl) {
- $content_shortened = common_shorten_link($pl['body']);
+ $body = trim($pl['body']);
+ $content_shortened = common_shorten_link($body);
if (mb_strlen($content_shortened) > 140) {
- $content = trim(mb_substr($pl['body'], 0, 140));
+ $content = trim(mb_substr($body, 0, 140));
$content_shortened = common_shorten_link($content);
}
else {
- $content = $pl['body'];
+ $content = $body;
}
$notice = Notice::saveNew($user->id, $content, 'xmpp');
if (is_string($notice)) {