[open-ils-commits] r13168 - trunk/Open-ILS/web/opac/skin/default/js (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri May 15 11:25:08 EDT 2009
Author: miker
Date: 2009-05-15 11:25:07 -0400 (Fri, 15 May 2009)
New Revision: 13168
Modified:
trunk/Open-ILS/web/opac/skin/default/js/myopac.js
Log:
avoid regex-izing user supplied strings
Modified: trunk/Open-ILS/web/opac/skin/default/js/myopac.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/myopac.js 2009-05-15 08:21:17 UTC (rev 13167)
+++ trunk/Open-ILS/web/opac/skin/default/js/myopac.js 2009-05-15 15:25:07 UTC (rev 13168)
@@ -800,8 +800,9 @@
}
var iv1 = user.ident_value()+'';
- if (iv1.length > 4) iv1 = iv1.replace(new RegExp(iv1.substring(0,iv1.length - 4)), '***********');
+ if (iv1.length > 4 && iv1.match(/\d{4}/)) iv1 = iv1.substring(0,4) + '***********';
+
appendClear($('myopac_summary_prefix'),text(user.prefix()));
appendClear($('myopac_summary_first'),text(user.first_given_name()));
appendClear($('myopac_summary_middle'),text(user.second_given_name()));
More information about the open-ils-commits
mailing list