Skip to content

Commit

Permalink
Fix for php 5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Narloch committed Mar 4, 2017
1 parent e8c27d1 commit 26cccca
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions administrator/components/com_installer/models/languages.php
Expand Up @@ -143,14 +143,17 @@ protected function getLanguages()
$languages[$language->name] = $language;
}

// Workaround for php 5.3
$that = $this;

// Sort the array by value of subarray
usort(
$languages,
function($a, $b)
function($a, $b) use ($that)
{
$ordering = $this->getState('list.ordering');
$ordering = $that->getState('list.ordering');

if (strtolower($this->getState('list.direction')) === 'asc')
if (strtolower($that->getState('list.direction')) === 'asc')
{
return StringHelper::strcmp($a->$ordering, $b->$ordering);
}
Expand Down

0 comments on commit 26cccca

Please sign in to comment.