From 0e96c55de25f9e6a33ff04e3b02b7a1d634981cf Mon Sep 17 00:00:00 2001 From: Boy Baukema Date: Fri, 12 Dec 2014 12:22:00 +0100 Subject: [PATCH] Protect against notices for translate functions without variables in them. --- library/EngineBlock/View.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/EngineBlock/View.php b/library/EngineBlock/View.php index baa3838cd9..d552a09f2a 100644 --- a/library/EngineBlock/View.php +++ b/library/EngineBlock/View.php @@ -76,6 +76,11 @@ public function translate($from, $arg1 = null) $arguments = func_get_args(); $arguments[0] = $translator->translate($from); + + if (count($arguments) === 1) { + return $arguments[0]; + } + return call_user_func_array('sprintf', $arguments); } @@ -238,4 +243,4 @@ protected function _getLanguageFallback(array $entity, $key, $lang) { return null; } -} \ No newline at end of file +}