]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Avoid notice in DirectionDetectorPlugin when dealing with empty string.
authorBrion Vibber <brion@pobox.com>
Mon, 18 Oct 2010 19:23:01 +0000 (12:23 -0700)
committerBrion Vibber <brion@pobox.com>
Mon, 18 Oct 2010 19:23:01 +0000 (12:23 -0700)
plugins/DirectionDetector/DirectionDetectorPlugin.php

index 1473c386fac114575fece935555e571881cc38b8..4a38f390f10a814089abba753c1fef5a5d2aa896 100644 (file)
@@ -81,6 +81,9 @@ class DirectionDetectorPlugin extends Plugin {
      * @return boolean
      */
     public static function startsWithRTLCharacter($str){
+        if (strlen($str) < 1) {
+            return false;
+        }
         if( is_array($cc = self::utf8ToUnicode(mb_substr($str, 0, 1, 'utf-8'))) )
             $cc = $cc[0];
         else