]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
CUPS Web UI: Fix uninitialized variable during driver selection 242/head
authorZdenek Dohnal <zdohnal@redhat.com>
Mon, 6 Sep 2021 11:24:41 +0000 (13:24 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Mon, 6 Sep 2021 11:24:41 +0000 (13:24 +0200)
If device uri doesn't contain model name, `current_make_and_model` is
uninitialized during driver selection in CUPS Web UI.

The issue manifests itself during choosing IPP Everywhere driver, which
has the variable in its name, so it ends up into
`{current_make_and_model} - IPP Everywhere`.

Since we don't have any info about model at the time, I would propose to
just shorten the driver name for such cases. The PR works that way.

CHANGES.md
templates/choose-model.tmpl

index a2b393a1d459b479441d74d4c8810f2c1d02dfb8..4d6bfc6db0f5bcc76a87e1670633f3bfca9ebd07 100644 (file)
@@ -64,6 +64,7 @@ CUPS v2.4rc1 (Pending)
   `LPDConfigFile`, `KeepAliveTimeout`, `RIPCache`, and `SMBConfigFile`
   directives in `cupsd.conf` and `cups-files.conf`.
 - Stubbed out deprecated `httpMD5` functions.
+- Fixed uninitialized variable during driver selection in Web UI
 
 
 CUPS v2.3.3op2 (February 1, 2021)
index e916cf8a092a8dbc34f5b0ba3ca6251b1d2d4bb9..9c9b71f22c7e4f04b14aa14e1e66a2161f4b40e1 100644 (file)
@@ -39,7 +39,7 @@
 <TD>
 <SELECT NAME="PPD_NAME" SIZE="10">
 {op=add-printer?:<OPTION VALUE="__no_change__" SELECTED>Current Driver - {current_make_and_model}</OPTION>:}
-{show_ipp_everywhere?<OPTION VALUE="everywhere" SELECTED>{current_make_and_model} - IPP Everywhere &trade;</OPTION>:}
+{show_ipp_everywhere?<OPTION VALUE="everywhere" SELECTED>{current_make_and_model?{current_make_and_model} -:} IPP Everywhere &trade;</OPTION>:}
 {[ppd_name]<OPTION VALUE="{ppd_name}" {op=modify-printer?:{?current_make_and_model={ppd_make_and_model}?SELECTED:}}>{ppd_make_and_model} ({ppd_natural_language})
 }</SELECT>
 </TD>