From f7db7f578e6fbab4e3942ae7235f7d39c986af83 Mon Sep 17 00:00:00 2001 From: dbs Date: Fri, 29 May 2009 19:53:10 +0000 Subject: [PATCH] Use Unicode-friendly regular expressions for registering and retrieving patrons by name MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This enables patrons with names like Étienne or ԱԲԳԱՐ to be registered and retrieved git-svn-id: svn://svn.open-ils.org/ILS/trunk@13263 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/patron/search_form.js | 2 +- Open-ILS/xul/staff_client/server/patron/ue_config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/patron/search_form.js b/Open-ILS/xul/staff_client/server/patron/search_form.js index 72211296b7..76759047c5 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_form.js +++ b/Open-ILS/xul/staff_client/server/patron/search_form.js @@ -317,7 +317,7 @@ patron.search_form.prototype = { case 'family_name' : case 'first_given_name' : case 'second_given_name' : - value = value.replace(/^\W+/g,'').replace(/\W+$/g,''); + value = value.replace(/^[\d\s]+/g,'').replace(/[\d\s]+$/g,'') break; } if (value != '') { diff --git a/Open-ILS/xul/staff_client/server/patron/ue_config.js b/Open-ILS/xul/staff_client/server/patron/ue_config.js index 5761b7991d..e4c3fd4052 100644 --- a/Open-ILS/xul/staff_client/server/patron/ue_config.js +++ b/Open-ILS/xul/staff_client/server/patron/ue_config.js @@ -32,7 +32,7 @@ const unameRegex = /^\w[\.\w\@-]*$/; const ssnRegex = /^\d{3}-\d{2}-\d{4}$/; const dlRegex = /^[a-zA-Z]{2}-\w+/; /* driver's license */ const phoneRegex = /^\d{3}-\d{3}-\d{4}(| \S+.*)$/i; -const nonumRegex = /^[a-zA-Z]\D*$/; /* no numbers, no beginning whitespace */ +const nonumRegex = /^[^\d\s]+[\d]*$/; /* no numbers, no beginning whitespace */ const dateRegex = /^\d{4}-\d{2}-\d{2}/; const zipRegex = /^\d{5}(-\d{4}|-?$)/; /* 12345 or 12345-6789 */ -- 2.43.2