From 431b9589b6d49b1ce147724625a02cb9e32e7809 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 1 May 2012 22:13:50 +0200 Subject: [PATCH] BUGFIX Fixed arguments in global _t() function, added check for $returnValue fallback that its not the injection array as second parameter --- core/Core.php | 4 ++-- i18n/i18n.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/Core.php b/core/Core.php index a340abeff..d2e25d102 100644 --- a/core/Core.php +++ b/core/Core.php @@ -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); } /** diff --git a/i18n/i18n.php b/i18n/i18n.php index d66d1979b..c350797f6 100644 --- a/i18n/i18n.php +++ b/i18n/i18n.php @@ -1488,7 +1488,7 @@ class i18n extends Object implements TemplateGlobalProvider { $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) {