From 4053d5bea4e1dd936a9a8bfd41cae3efd7af2d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 23 Aug 2019 15:29:32 +0200 Subject: [PATCH] MOBILE-3068 lang: Remove warning when adding new strings --- scripts/lang_functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lang_functions.php b/scripts/lang_functions.php index 56158a469..af1e2ab3b 100644 --- a/scripts/lang_functions.php +++ b/scripts/lang_functions.php @@ -316,7 +316,7 @@ function save_key($key, $value, $path) { $file = file_get_contents($filePath); $file = (array) json_decode($file); $value = html_entity_decode($value); - if ($file[$key] != $value) { + if (!isset($file[$key]) || $file[$key] != $value) { $file[$key] = $value; ksort($file); file_put_contents($filePath, str_replace('\/', '/', json_encode($file, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)));