diff --git a/framework/core/src/Http/Controller/AbstractClientController.php b/framework/core/src/Http/Controller/AbstractClientController.php index 4512f8d8c..7bd942f30 100644 --- a/framework/core/src/Http/Controller/AbstractClientController.php +++ b/framework/core/src/Http/Controller/AbstractClientController.php @@ -312,12 +312,14 @@ abstract class AbstractClientController extends AbstractHtmlController */ protected function filterTranslations(array $translations, array $keys) { - return array_filter($translations, function ($id) use ($keys) { + $filtered = array_filter(array_keys($translations), function ($id) use ($keys) { foreach ($keys as $key) { if (substr($id, 0, strlen($key)) === $key) { return true; } } - }, ARRAY_FILTER_USE_KEY); + }); + + return array_only($translations, $filtered); } }