]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
use mb_strlen instead of strlen in xmpp daemon
authorEvan Prodromou <evan@prodromou.name>
Mon, 25 Aug 2008 17:31:05 +0000 (13:31 -0400)
committerEvan Prodromou <evan@prodromou.name>
Mon, 25 Aug 2008 17:31:05 +0000 (13:31 -0400)
darcs-hash:20080825173105-84dde-ea607521c78694fe558514b423f1c6dc0e70241e.gz

scripts/xmppdaemon.php

index 1db6687d0f8698ec1f358fabcc06d9d6576b943d..2fe99bbcf937ed73752745989ec87b05f8532c04 100755 (executable)
@@ -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);