From c73fe8b4c110fd4247488de488df7be49a094304 Mon Sep 17 00:00:00 2001 From: Dmitriy Novash Date: Thu, 1 Oct 2020 11:32:54 +0300 Subject: [PATCH] Fix compile if no language selected --- compiler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler.php b/compiler.php index ebc4c26..c90a351 100755 --- a/compiler.php +++ b/compiler.php @@ -37,7 +37,11 @@ foreach ($options as $key => $value) if (substr($key, 0, 4) == "lang") $langs = array_merge($langs, explode(",", $value)); $langs = array_unique($langs); -$vars['default_lang'] = ($langs[0] == "all") ? "en" : $langs[0]; +if (!empty($langs)) { + $vars['default_lang'] = ($langs[0] == "all") ? "en" : $langs[0]; +} else { + $vars['default_lang'] = "en"; +} // ensure english is available, as it gets merged with the other languages // in case of missing keys in other languages. if (!in_array("all", $langs) || !in_array("en", $langs))