OpenPrinting / cups

OpenPrinting CUPS Sources
https://openprinting.github.io/cups
Apache License 2.0
957 stars 174 forks source link

CUPS when adding a printer via the web interface gives an incorrect URI device #998

Open Gerben100 opened 6 days ago

Gerben100 commented 6 days ago

CUPS when adding a printer via the web interface gives an incorrect URI device

Steps: 1) Connect the printer via USB to the PC; 2) Menu -> System -> Printing settings (CUPS settings) -> Administration -> Add a printer -> Select the desired printer -> Continue.

Result: hieroglyphs in the "Connection" field. 1

Details:

Expected result: correct display of characters.

A little analysis revealed that this commit f9927a4b08642dffc44cd41689ee70c171f34a39 breaks symbols.

The problem seems to be in this line

Replacing the cgiGetTextfield() function with cgiGetVariable() solves the problem, but is this a correct fix?


     }
   }

-  if ((var = cgiGetTextfield("DEVICE_URI")) != NULL)
+  if ((var = cgiGetVariable("DEVICE_URI")) != NULL)
   {
     if ((uriptr = strrchr(var, '|')) != NULL)
     {
michaelrsweet commented 4 days ago

Confirmed, will debug further to determine the best solution.