diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-08-25 13:31:05 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-08-25 13:31:05 -0400 |
commit | 55b6e17ee1bcbf09be085a63b39534c7144547f2 (patch) | |
tree | 61cff6c7089f58e3d6edf13488fdf483eb9c30f6 /scripts | |
parent | 3fda5a684fcc6b718a8e5e908cd17477335ea071 (diff) |
use mb_strlen instead of strlen in xmpp daemon
darcs-hash:20080825173105-84dde-ea607521c78694fe558514b423f1c6dc0e70241e.gz
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/xmppdaemon.php | 7 |
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); |