[open-ils-commits] [GIT] Evergreen ILS branch master updated. 2e80fde8c4ffdc9924db3baf59520282a8a83169

Evergreen Git git at git.evergreen-ils.org
Wed Jan 11 00:02:39 EST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  2e80fde8c4ffdc9924db3baf59520282a8a83169 (commit)
      from  eab328fb3ad022a82d6fe3fddf1317ba6aa2f2a5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2e80fde8c4ffdc9924db3baf59520282a8a83169
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Mon Dec 19 15:55:52 2011 -0500

    Receipt Template Non-String Protection
    
    Don't try to replace on things that aren't strings.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>

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 414c8d7..166b486 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/print.js
+++ b/Open-ILS/xul/staff_client/chrome/content/util/print.js
@@ -108,6 +108,7 @@ util.print.prototype = {
 
     'escape_html' : function(data) {
         if (typeof data == 'object') { return ''; }
+        if (typeof data != 'string') { return data; }
         return data.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
     },
 
@@ -406,7 +407,7 @@ util.print.prototype = {
                     for (var i in params.data) {
                         var re = new RegExp('%'+i+'%',"g");
                         if (typeof params.data[i] == 'string' || typeof params.data[i] == 'number') {
-                            try{b = s; s=s.replace(re, (typeof params.data[i] == 'string' ? this.escape_html(params.data[i]) : params.data[i]));}
+                            try{b = s; s=s.replace(re, this.escape_html(params.data[i]));}
                                 catch(E){s = b; this.error.standard_unexpected_error_alert('print.js, template_sub(): 3 string = <' + s + '>',E);}
                         } else {
                             /* likely a null, print as an empty string */

-----------------------------------------------------------------------

Summary of changes:
 .../xul/staff_client/chrome/content/util/print.js  |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list