[open-ils-commits] r13169 - branches/rel_1_4/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:48 EDT 2009
Author: miker
Date: 2009-05-15 11:25:46 -0400 (Fri, 15 May 2009)
New Revision: 13169
Modified:
branches/rel_1_4/Open-ILS/web/opac/skin/default/js/myopac.js
Log:
avoid regex-izing user supplied strings
Modified: branches/rel_1_4/Open-ILS/web/opac/skin/default/js/myopac.js
===================================================================
--- branches/rel_1_4/Open-ILS/web/opac/skin/default/js/myopac.js 2009-05-15 15:25:07 UTC (rev 13168)
+++ branches/rel_1_4/Open-ILS/web/opac/skin/default/js/myopac.js 2009-05-15 15:25:46 UTC (rev 13169)
@@ -783,7 +783,7 @@
}
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()));
More information about the open-ils-commits
mailing list