Closed tresf closed 8 years ago
@bberenz can we revisit this bug for 2.0? There's really no advantage in using RegEx in my opinion as programmers can do that client-side if they wish.
https://github.com/qzind/qz-print/blob/2.0/src/qz/printer/PrintServiceMatcher.java#L69:L129
Can you clarify how you want findPrinter
to work in that case?
It seems like you want the method to return a PrintService for exact matches on the name string, and partial matches will be handled client side only from searching the printer list.
This bug is for qz-print versions 1.9.x and older (1.8.0 included) and breaks printer searching for search parameters containing
backslash E
(\E
or JavaScript"\\E"
also"\\\\E"
).Example
If a printer shared on a Windows or Samba network with "E" as part of the host name, for example:
And you perform a search like this:
You will receive the following exception:
This is caused by the special RegEx character
\E
being used within a Pattern match.Work-around 1 Replace uppercase
\E
with lowercase\e
:Reason
Work-around 2 Perform JavaRegex pattern escaping:
Reason
More information on these E's and Q's here:
Permanent Fix
The long term fix to this is to use
Pattern.quote(printerName);
internal to the applet, which will be corrected with 2.0.0.-Tres