summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-08-25 13:31:05 -0400
committerEvan Prodromou <evan@prodromou.name>2008-08-25 13:31:05 -0400
commit55b6e17ee1bcbf09be085a63b39534c7144547f2 (patch)
tree61cff6c7089f58e3d6edf13488fdf483eb9c30f6
parent3fda5a684fcc6b718a8e5e908cd17477335ea071 (diff)
use mb_strlen instead of strlen in xmpp daemon
darcs-hash:20080825173105-84dde-ea607521c78694fe558514b423f1c6dc0e70241e.gz
-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);