Skip to content

Commit

Permalink
Fix "Use this" for printers with backslashes in their names
Browse files Browse the repository at this point in the history
  • Loading branch information
tresf committed Jul 25, 2023
1 parent b34616b commit eb295cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,7 @@ <h4 class="panel-title">Options</h4>
qz.printers.find().then(function(data) {
var list = '';
for(var i = 0; i < data.length; i++) {
var button = '<button class="btn btn-default btn-xs" onclick="findPrinter(\'' + data[i] + '\', true)" data-dismiss="alert">Use This</button>'
var button = '<button class="btn btn-default btn-xs" onclick="findPrinter(\'' + data[i].replace(/\\/g, "\\\\") + '\', true)" data-dismiss="alert">Use This</button>'
list += "&nbsp; " + data[i] + "&nbsp;" + button + "<br/>";
}

Expand Down

0 comments on commit eb295cb

Please sign in to comment.