From: Brion Vibber Date: Mon, 18 Oct 2010 19:23:01 +0000 (-0700) Subject: Avoid notice in DirectionDetectorPlugin when dealing with empty string. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d67a9b437c3545b3a435953dbb529b64934cc767;p=quix0rs-gnu-social.git Avoid notice in DirectionDetectorPlugin when dealing with empty string. --- diff --git a/plugins/DirectionDetector/DirectionDetectorPlugin.php b/plugins/DirectionDetector/DirectionDetectorPlugin.php index 1473c386fa..4a38f390f1 100644 --- a/plugins/DirectionDetector/DirectionDetectorPlugin.php +++ b/plugins/DirectionDetector/DirectionDetectorPlugin.php @@ -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