Skip to content

Commit

Permalink
improved language handling for third party context
Browse files Browse the repository at this point in the history
  • Loading branch information
mxkmp29 authored and mxkmp29 committed Aug 11, 2016
1 parent b1e31cb commit 8aae1a4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions libraries/joomla/form/rule/username.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry
$result = true;
$app = JFactory::getApplication();

// Load language files
if ($app->isSite())
{
JFactory::getLanguage()->load('com_users', JPATH_SITE, null, true);
}
elseif ($app->isAdmin())
{
JFactory::getLanguage()->load('com_users', JPATH_ADMINISTRATOR, null, true);
}
// Get the database object and a new query object.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
Expand Down Expand Up @@ -310,9 +319,6 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry
}
}



return $result;
}
}

0 comments on commit 8aae1a4

Please sign in to comment.