use mb_strlen instead of strlen in xmpp daemon

darcs-hash:20080825173105-84dde-ea607521c78694fe558514b423f1c6dc0e70241e.gz
This commit is contained in:
Evan Prodromou 2008-08-25 13:31:05 -04:00
parent 3fda5a684f
commit 55b6e17ee1
1 changed files with 4 additions and 3 deletions

View File

@ -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);