Project

General

Profile

Bug #93346 ยป local_history.patch

Dieter Porth, 2021-01-22 11:11

View differences:

Source/web/typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php (date 1611313296931)
// This unrolls arguments from $arguments - instead of calling vsprintf which receives arguments as an array.
// The reason is that only sprintf() will return an error message if the number of arguments does not match
// the number of placeholders in the format string. Whereas, vsprintf would silently return nothing.
return sprintf($value, ...array_values($arguments)) ?: sprintf('Error: could not translate key "%s" with value "%s" and %d argument(s)!', $key, $value, count($arguments));
try {
// PHP 8.0.0 sprintf no longer returns false on failure.
return sprintf($value, ...array_values($arguments))?:sprintf('Error: could not translate key "%s" with value "%s" and %d argument(s)!', $key, $value, count($arguments));
} catch ( \Exception $e ) {
throw new \InvalidArgumentException(
sprintf('Error: could not translate key "%s" with value "%s" and %d argument(s)!', $key, $value, count($arguments)).
"\nmessage: ".$e->getMessage(),
1611312869
);
}
}
return $value;
}
    (1-1/1)