From: Jeff Godin Date: Mon, 10 Oct 2011 20:18:49 +0000 (-0400) Subject: Better handling of undefined values in receipts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=12a767ba2d05603219bcc59a40f4ad7fba277948;p=working%2FEvergreen.git Better handling of undefined values in receipts Teach escape_html to return an empty string when given an undefined value as input. Previously: a macro being replaced with an undefined value resulted in the macro itself remaining in the output. Now: a macro being replaced with an undefined value will result in an empty string in the output. --- diff --git a/Open-ILS/xul/staff_client/chrome/content/util/print.js b/Open-ILS/xul/staff_client/chrome/content/util/print.js index 49fa358a84..bb3b6116eb 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/print.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/print.js @@ -96,7 +96,11 @@ util.print.prototype = { }, 'escape_html' : function(data) { - return data.replace(/&/g,'&').replace(//g,'>'); + if (data) { + return data.replace(/&/g,'&').replace(//g,'>'); + } else { + return ''; + } }, 'simple' : function(msg,params) {