From e9b7be158cbddc6c4e1b5e3537b1f05fbf53c984 Mon Sep 17 00:00:00 2001
From: Okhin <okhin@okhin.fr>
Date: Mon, 17 Dec 2018 19:31:38 +0100
Subject: [PATCH] Fuck php5 which cannot define global arrays

---
 app/config.php                | 2 +-
 app/controller/controller.php | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/app/config.php b/app/config.php
index ef40d0b..705af37 100644
--- a/app/config.php
+++ b/app/config.php
@@ -28,7 +28,7 @@ define("CTX_MODE", getenv('CTX_MODE'));
 //define("CERTIFICATE","XXXXXXXXXXXXXXXXXXXXXXXXx");
 //define("CTX_MODE","PRODUCTION");
 
-define("LANGUAGES", ["fr_FR", "en_US"]);
+define("LANGUAGES", "fr_FR,en_US");
 
 define("PIPLOME_PATH", getenv('PIPLOME_PATH'));
 define("PIPLOME_URL", getenv('PIPLOME_URL'));
diff --git a/app/controller/controller.php b/app/controller/controller.php
index f935182..202731e 100644
--- a/app/controller/controller.php
+++ b/app/controller/controller.php
@@ -40,7 +40,7 @@ class Controller
             }
         }
 
-        foreach (LANGUAGES as $language) {
+        foreach (explode(',', LANGUAGES) as $language) {
             foreach ($accept_languages as $accept_language) {
                 if (strpos($language, $accept_language)>=0) {
                     $lang = $language;
@@ -49,9 +49,7 @@ class Controller
             }
         }
 
-        var_dump($lang);
         if (!bindtextdomain("messages", "../locales/")) {
-            var_dump(bindtextdomain("messages", "../locales/"));
             echo "<!-- bondtextdomain failed -->";
         }
         // Language ok, set the locale environment
-- 
GitLab