View Issue Details

IDProjectCategoryView StatusLast Update
0016752phplist applicationInternationalization (l18n)public18-03-13 16:41
Reporterduncanc 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.11.7 
Target VersionFixed 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();
    array_shift($args);
    $translation = vsprintf($translation, $args);
  }
  return $translation;
}
TagsNo tags attached.

Activities

michiel

18-03-13 16:41

manager   ~0051955

brilliant! so much better that way