diff options
| author | 2023-01-18 23:39:30 +0100 | |
|---|---|---|
| committer | 2023-01-18 23:39:30 +0100 | |
| commit | d105761fec48b388aa96e5089111b5c5ae941df2 (patch) | |
| tree | 3422ee49de2cedfd09e8db81ed235be948570f28 | |
| parent | daaa391e33c5d92e3dd91bb0b81ac420abed7097 (diff) | |
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).
| -rw-r--r-- | lib/Minz/Translate.php | 2 |
1 files changed, 1 insertions, 1 deletions
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); } /** |
