From: Michael R Sweet Date: Mon, 23 Sep 2024 13:17:42 +0000 (-0400) Subject: Escape localized strings in PPDs. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8361420cbbfa2e729545c4c537c49fc6322c9631;p=thirdparty%2Fcups.git Escape localized strings in PPDs. --- diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index 2662738eb2..90784aa7bc 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -5611,7 +5611,21 @@ ppd_put_strings(cups_file_t *fp, /* I - PPD file */ for (lang = langs; lang; lang = lang->next) { if (strcmp(lang->language, "en") && (text = _cupsLangString(lang, pwg_msgid)) != pwg_msgid) - cupsFilePrintf(fp, "*%s.%s %s/%s: \"\"\n", lang->language, ppd_option, ppd_choice, text); + { + // Add the first line of localized text... + cupsFilePrintf(fp, "*%s.%s %s/", lang->language, ppd_option, ppd_choice); + while (*text && *text != '\n') + { + // Escape ":" and "<"... + if (*text == ':' || *text == '<') + cupsFilePrintf(fp, "<%02X>", *text); + else + cupsFilePutChar(fp, *text); + + text ++; + } + cupsFilePuts(fp, ": \"\"\n"); + } } }