Skip to content

Commit

Permalink
BUGFIX Fixed arguments in global _t() function, added check for $retu…
Browse files Browse the repository at this point in the history
…rnValue fallback that its not the injection array as second parameter
  • Loading branch information
chillu committed May 1, 2012
1 parent 0597e91 commit 431b958
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/Core.php
Expand Up @@ -386,8 +386,8 @@ function stripslashes_recursively(&$array) {
/**
* @see i18n::_t()
*/
function _t($entity, $string = "", $context = "") {
return i18n::_t($entity, $string, $context);
function _t($entity, $string = "", $context = "", $injection = "") {
return i18n::_t($entity, $string, $context, $injection);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion i18n/i18n.php
Expand Up @@ -1488,7 +1488,7 @@ static function _t($entity, $string = "", $context = "", $injection = "") {
$translatorsByPrio = self::$translators;
if(!$translatorsByPrio) $translatorsByPrio = self::get_translators();

$returnValue = $string; // Fall back to default string argument
$returnValue = (is_string($string)) ? $string : ''; // Fall back to default string argument

foreach($translatorsByPrio as $priority => $translators) {
foreach($translators as $name => $translator) {
Expand Down

0 comments on commit 431b958

Please sign in to comment.