From d105761fec48b388aa96e5089111b5c5ae941df2 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 18 Jan 2023 23:39:30 +0100 Subject: i18n safer vsprintf (#5022) Fix bug introduced by https://github.com/FreshRSS/FreshRSS/pull/4807 though only for the French i18n, wich has some `%` signs in the URL, making `vsprintf` to crash. Only use `vsprintf`` when we call the translation with some parameters, otherwise skip it (probably faster as well). --- lib/Minz/Translate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Minz/Translate.php b/lib/Minz/Translate.php index 19a86a00e..584f08aa0 100644 --- a/lib/Minz/Translate.php +++ b/lib/Minz/Translate.php @@ -232,7 +232,7 @@ class Minz_Translate { } // Get the facultative arguments to replace i18n variables. - return vsprintf($translation_value, $args); + return empty($args) ? $translation_value : vsprintf($translation_value, $args); } /** -- cgit v1.2.3