From 153121b95d65f3ffbc87c533b76de5cab94aa41b Mon Sep 17 00:00:00 2001 From: altairis Date: Thu, 3 Oct 2019 15:48:24 +0200 Subject: [PATCH 1/2] add MAIN_LANGUAGES_ALLOWED constant --- htdocs/core/class/translate.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 8f9dc32901d..dd5f1e6769d 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -781,6 +781,8 @@ class Translate if (preg_match('/^[a-z]+_[A-Z]+/i', $dir)) { $this->load("languages"); + + if (! empty($conf->global->MAIN_LANGUAGES_ALLOWED) && ! in_array($dir, explode(',' , $conf->global->MAIN_LANGUAGES_ALLOWED)) ) continue; if ($usecode == 2) { From 3168ad404c9c420befd74a139ad4b75ebe549b76 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 3 Oct 2019 13:56:33 +0000 Subject: [PATCH 2/2] Fixing style errors. --- htdocs/core/class/translate.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index dd5f1e6769d..3780ab35b06 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -782,7 +782,7 @@ class Translate { $this->load("languages"); - if (! empty($conf->global->MAIN_LANGUAGES_ALLOWED) && ! in_array($dir, explode(',' , $conf->global->MAIN_LANGUAGES_ALLOWED)) ) continue; + if (! empty($conf->global->MAIN_LANGUAGES_ALLOWED) && ! in_array($dir, explode(',', $conf->global->MAIN_LANGUAGES_ALLOWED)) ) continue; if ($usecode == 2) {