From 46d132d0c8c0310ed5307c300b945e2400c53ae0 Mon Sep 17 00:00:00 2001 From: sgiehl <stefan@piwik.org> Date: Fri, 16 Aug 2013 21:44:13 +0200 Subject: [PATCH] use array_replace_recursive, as array_merge_recursive produces arrays for existing keys --- core/Translate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/Translate.php b/core/Translate.php index 045774b855..5348c1a1b3 100644 --- a/core/Translate.php +++ b/core/Translate.php @@ -77,7 +77,7 @@ class Translate if (!Common::isValidFilename($language) || !is_readable($path)) { throw new Exception(Piwik_TranslateException('General_ExceptionLanguageFileNotFound', array($language))); } - $data = file_get_contents($path); + $data = file_get_contents($path); $translations = json_decode($data, true); $this->mergeTranslationArray($translations); $this->setLocale(); @@ -90,7 +90,7 @@ class Translate $GLOBALS['Piwik_translations'] = array(); } // we could check that no string overlap here - $GLOBALS['Piwik_translations'] = array_merge_recursive($GLOBALS['Piwik_translations'], $translation); + $GLOBALS['Piwik_translations'] = array_replace_recursive($GLOBALS['Piwik_translations'], $translation); } /** -- GitLab