From d67a9b437c3545b3a435953dbb529b64934cc767 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 18 Oct 2010 12:23:01 -0700 Subject: [PATCH] Avoid notice in DirectionDetectorPlugin when dealing with empty string. --- plugins/DirectionDetector/DirectionDetectorPlugin.php | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.39.2