From ead3023a21f41b4ca79b777f859feb5b55dc5cd8 Mon Sep 17 00:00:00 2001 From: filip Date: Wed, 15 Feb 2017 21:48:02 +0100 Subject: handling an eror in case of missing l10n file or it's parsing error --- langs.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'langs.inc.php') diff --git a/langs.inc.php b/langs.inc.php index aae94b38c..bd6af3bda 100644 --- a/langs.inc.php +++ b/langs.inc.php @@ -471,7 +471,12 @@ function read_translation_file($locale, $name_of_translation) if ($locale == 'en') { $path_filename .= 't'; } - return phpmo_parse_po_file(G_APP_ROOT . $path_filename); + $dictionary_from_file = phpmo_parse_po_file(G_APP_ROOT . $path_filename); + if (is_array($dictionary_from_file)) { + return $dictionary_from_file; + } else { + return array(); // in case of missing l10n file or it's parsing error + } } } -- cgit v1.2.1