Skip to content

Commit

Permalink
Protect against notices for translate functions without variables in …
Browse files Browse the repository at this point in the history
…them.
  • Loading branch information
Boy Baukema committed Dec 19, 2014
1 parent ffa5160 commit 0e96c55
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion library/EngineBlock/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -238,4 +243,4 @@ protected function _getLanguageFallback(array $entity, $key, $lang) {
return null;
}

}
}

0 comments on commit 0e96c55

Please sign in to comment.