From 539603fbcde66ff860c832037d2404b81aca5bb3 Mon Sep 17 00:00:00 2001 From: Quy Date: Mon, 30 Apr 2018 15:31:48 -0700 Subject: [PATCH] Tiny JLanguage::loadLanguage() code improvement (#20257) --- libraries/src/Language/Language.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libraries/src/Language/Language.php b/libraries/src/Language/Language.php index 0f384d5937b27..72acb92a1739c 100644 --- a/libraries/src/Language/Language.php +++ b/libraries/src/Language/Language.php @@ -791,13 +791,10 @@ protected function loadLanguage($filename, $extension = 'unknown') $strings = $this->parse($filename); } - if ($strings) + if (is_array($strings) && count($strings)) { - if (is_array($strings) && count($strings)) - { - $this->strings = array_replace($this->strings, $strings, $this->override); - $result = true; - } + $this->strings = array_replace($this->strings, $strings, $this->override); + $result = true; } // Record the result of loading the extension's file.