diff options
author | Michal Čihař <michal@cihar.com> | 2011-08-15 11:18:15 +0400 |
---|---|---|
committer | Michal Čihař <michal@cihar.com> | 2011-08-15 11:18:18 +0400 |
commit | e7cc67a5f6b6c7e71b3c79ff501cf04cca443cc9 (patch) | |
tree | 051b87eded71e4a29c78332a70667fe0395dbbd5 /scripts | |
parent | 9be2507a58d4a32b4daaa55f39bd0cd844f99533 (diff) |
Always escape % for gettext
Otherwise it is treated like format string.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/advisor2php | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/scripts/advisor2php b/scripts/advisor2php index 28a58176fe..7bc85677db 100644 --- a/scripts/advisor2php +++ b/scripts/advisor2php @@ -18,16 +18,11 @@ echo "/* This is automatically generated file from libraries/advisory_rules.txt foreach($rules['rules'] as $rule) { echo "\n"; - echo "echo __('" . addslashes($rule['name']) . "');\n"; - echo "echo __('" . addslashes($rule['issue']) . "');\n"; - echo "echo __('" . addslashes($rule['recommendation']) . "');\n"; + echo "printf(__('" . addslashes(Advisor::escapePercent($rule['name'])) . "'));\n"; + echo "printf(__('" . addslashes(Advisor::escapePercent($rule['issue'])) . "'));\n"; + echo "printf(__('" . addslashes(Advisor::escapePercent($rule['recommendation'])) . "'));\n"; $jst = Advisor::splitJustification($rule); - if (count($jst) > 1) { - /* printf is used here just to ensure proper type of string */ - echo "printf(__('" . addslashes($jst[0]) . "'), 0);\n"; - } else { - echo "echo __('" . addslashes($jst[0]) . "');\n"; - } + echo "printf(__('" . addslashes(Advisor::escapePercent($jst[0])) . "'));\n"; } ?> |