From 60a68a50d797158f89cda5767fa9a869e1a5d24b Mon Sep 17 00:00:00 2001 From: Oliver Hader Date: Tue, 6 Mar 2018 16:17:46 +0100 Subject: [PATCH] [BUGFIX] Avoid associative array to be used in LocalizationUtility On using associative array in LocalizationUtility which is e.g. used by Fluid's TranslateViewHelper, the error Cannot unpack array with string keys is thrown. The reason is that sprintf($value, ...$arguments) cannot be used with $arguments being an associative array. Resolves: #84149 Releases: master Change-Id: Ifb60338bcf9095954969221cf08bd7e3d141ecc2 Reviewed-on: https://review.typo3.org/56024 Tested-by: TYPO3com Reviewed-by: Mathias Brodala Tested-by: Mathias Brodala Reviewed-by: Andreas Fernandez Tested-by: Andreas Fernandez --- typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php | 2 +- .../Private/Partials/List/UnresolvedDependencies.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php b/typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php index 1f00f33cb4a7..3c748ceaf31b 100644 --- a/typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php +++ b/typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php @@ -127,7 +127,7 @@ public static function translate($key, $extensionName = null, $arguments = null, // 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, ...$arguments) ?: sprintf('Error: could not translate key "%s" with value "%s" and %d argument(s)!', $key, $value, count($arguments)); + return sprintf($value, ...array_values($arguments)) ?: sprintf('Error: could not translate key "%s" with value "%s" and %d argument(s)!', $key, $value, count($arguments)); } return $value; } diff --git a/typo3/sysext/extensionmanager/Resources/Private/Partials/List/UnresolvedDependencies.html b/typo3/sysext/extensionmanager/Resources/Private/Partials/List/UnresolvedDependencies.html index 8434b4c4dfc7..f2ecf2d2ad88 100644 --- a/typo3/sysext/extensionmanager/Resources/Private/Partials/List/UnresolvedDependencies.html +++ b/typo3/sysext/extensionmanager/Resources/Private/Partials/List/UnresolvedDependencies.html @@ -1,4 +1,4 @@ -

:

+

:

    @@ -19,4 +19,4 @@ -
\ No newline at end of file +