From d9a42550ff5653082c9d06aa9a48963599688bf4 Mon Sep 17 00:00:00 2001 From: Diogo Cordeiro Date: Tue, 14 May 2019 15:51:42 +0100 Subject: [PATCH] is_rtl should handle lang instead of code --- lib/language.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/language.php b/lib/language.php index 8ed4021401..f0144b4106 100644 --- a/lib/language.php +++ b/lib/language.php @@ -294,11 +294,13 @@ function get_nice_language_list() * @return boolean true if language is rtl */ -function is_rtl($lang) +function is_rtl($lang_value) { - $all_languages = common_config('site', 'languages'); - $lang = $all_languages[$lang]; - return ($lang['direction'] == 'rtl'); + foreach (common_config('site', 'languages') as $code => $info) { + if ($lang_value == $info['lang']) { + return $info['direction'] == 'rtl'; + } + } } /** -- 2.39.5