From 55b6e17ee1bcbf09be085a63b39534c7144547f2 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 25 Aug 2008 13:31:05 -0400 Subject: [PATCH] use mb_strlen instead of strlen in xmpp daemon darcs-hash:20080825173105-84dde-ea607521c78694fe558514b423f1c6dc0e70241e.gz --- scripts/xmppdaemon.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php index 1db6687d0f..2fe99bbcf9 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); -- 2.39.5