[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. dc218c85eaa217bfb0e00cb145f6d6554e740f50

Evergreen Git git at git.evergreen-ils.org
Wed Jan 11 00:04:26 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, rel_2_1 has been updated
       via  dc218c85eaa217bfb0e00cb145f6d6554e740f50 (commit)
      from  669dd0930025da28ec2a98b9ae706759b1abfc99 (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 dc218c85eaa217bfb0e00cb145f6d6554e740f50
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 d11602d..8127d3c 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/print.js
+++ b/Open-ILS/xul/staff_client/chrome/content/util/print.js
@@ -97,6 +97,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;');
     },
 
@@ -322,7 +323,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