View Issue Details

IDProjectCategoryView StatusLast Update
0016752phpList 3 applicationInternationalization (l18n)public18-03-13 16:41
Reporterduncanc Assigned To 
Status resolvedResolutionfixed 
Product Version2.11.7 
Fixed in Version2.11.8 
Summary0016752: Use vsprintf instead of eval
DescriptionProblem found in the SVN trunk version.

The function s() in file languages.php can be simplified by using the vsprintf() function, which takes an array of arguments, instead of eval.

function s($text) {
  ## allow overloading with sprintf paramaters
  $translation = $GLOBALS['I18N']->get($text);

  if (func_num_args() > 1) {
    $args = func_get_args();
    $translation = vsprintf($translation, $args);
  return $translation;
TagsNo tags attached.



18-03-13 16:41

administrator   ~0051955

brilliant! so much better that way