Skip to content

Commit

Permalink
Tiny JLanguage::loadLanguage() code improvement (#20257)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quy authored and Michael Babker committed Apr 30, 2018
1 parent 3d9ce7f commit 539603f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions libraries/src/Language/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 539603f

Please sign in to comment.