BUGFIX Fixed arguments in global _t() function, added check for $returnValue fallback that its not the injection array as second parameter

This commit is contained in:
Ingo Schommer 2012-05-01 22:13:50 +02:00
parent 0597e914ff
commit 431b9589b6
2 changed files with 3 additions and 3 deletions

View File

@ -386,8 +386,8 @@ function stripslashes_recursively(&$array) {
/** /**
* @see i18n::_t() * @see i18n::_t()
*/ */
function _t($entity, $string = "", $context = "") { function _t($entity, $string = "", $context = "", $injection = "") {
return i18n::_t($entity, $string, $context); return i18n::_t($entity, $string, $context, $injection);
} }
/** /**

View File

@ -1488,7 +1488,7 @@ class i18n extends Object implements TemplateGlobalProvider {
$translatorsByPrio = self::$translators; $translatorsByPrio = self::$translators;
if(!$translatorsByPrio) $translatorsByPrio = self::get_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($translatorsByPrio as $priority => $translators) {
foreach($translators as $name => $translator) { foreach($translators as $name => $translator) {