Avoid notice in DirectionDetectorPlugin when dealing with empty string.

This commit is contained in:
Brion Vibber 2010-10-18 12:23:01 -07:00
parent e04a6ef93e
commit d67a9b437c
1 changed files with 3 additions and 0 deletions

View 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