mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
0597e914ff
commit
431b9589b6
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user