summaryrefslogtreecommitdiff
path: root/scripts/xmppdaemon.php
diff options
context:
space:
mode:
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 1db6687d0..2fe99bbcf 100755
--- a/scripts/xmppdaemon.php
+++ b/scripts/xmppdaemon.php
@@ -154,7 +154,7 @@ class XMPPDaemon {
if ($pl['type'] != 'chat') {
return;
}
- if (strlen($pl['body']) == 0) {
+ if (mb_strlen($pl['body']) == 0) {
return;
}
@@ -177,8 +177,9 @@ class XMPPDaemon {
$this->log(LOG_INFO, 'Ignoring OTR from ' . $from);
return;
} else {
- if(strlen($pl['body'])>140) {
- $this->from_site($from, 'Message too long - maximum is 140 characters, you sent ' . strlen($pl['body']));
+ $len = mb_strlen($pl['body']);
+ if($len > 140) {
+ $this->from_site($from, 'Message too long - maximum is 140 characters, you sent ' . $len);
return;
}
$this->add_notice($user, $pl);