From aaa78172d8a46be8a1c3d35da13b399027d56b8f Mon Sep 17 00:00:00 2001 From: filip Date: Sun, 18 Sep 2016 22:58:36 +0200 Subject: better handling of invalid resource --- langs/report_tx_git.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'langs/report_tx_git.php') diff --git a/langs/report_tx_git.php b/langs/report_tx_git.php index c7dee5b7d..388ae2615 100644 --- a/langs/report_tx_git.php +++ b/langs/report_tx_git.php @@ -70,14 +70,15 @@ if (!empty($wanted_language) && !empty($wanted_resource_name)) { $details_wanted = TRUE; } +$parsed_tx_file_content = NULL; if ($details_wanted) { $prefixed_resource_name = resource_name_conversion($wanted_resource_name, $wanted_category); $tx_file = tx_call("resource/$prefixed_resource_name/translation/$wanted_language/"); - $tx_file_content = $tx_file['content']; - $tx_file_content = explode("\n", $tx_file_content); - $parsed_tx_file_content = phpmo_parse_po_file($tx_file_content, FALSE); -} else { - $parsed_tx_file_content = NULL; + if (!empty($tx_file)) { + $tx_file_content = $tx_file['content']; + $tx_file_content = explode("\n", $tx_file_content); + $parsed_tx_file_content = phpmo_parse_po_file($tx_file_content, FALSE); + } } // create separate array ($tx_resources_info) and add statistics to it from TX -- cgit v1.2.1