Permalink
Browse files

BUGFIX Fixed arguments in global _t() function, added check for $retu…

…rnValue fallback that its not the injection array as second parameter
  • Loading branch information...
1 parent 0597e91 commit 431b9589b6d49b1ce147724625a02cb9e32e7809 @chillu chillu committed May 1, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 core/Core.php
  2. +1 −1 i18n/i18n.php
View
@@ -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);
}
/**
View
@@ -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) {

0 comments on commit 431b958

Please sign in to comment.