From 9f7cd215ebcaf0647c23b7c337f45bb8aa199623 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 18 Oct 2016 15:34:34 -0400 Subject: [PATCH] JBAS-1638 Patron self-reg cleans spaces Remove leading / trailing spaces from user-entered values in patron self-registration app. In addition to resulting in cleaner data, it allows the patron editor's duplicate patron search code to work w/ like values. Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm index ff6c9830cd..6bdd3d0181 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm @@ -477,6 +477,9 @@ sub inspect_register_value { my %keep_case = (usrname => 1, passwd => 1, email => 1); $value = uc($value) unless $keep_case{$field}; + # JBAS-1638 remove opening/trailing spaces + $value =~ s/(^\s*|\s*$)//g; + my $regex = $self->{register}{settings}{$scls}{$field}{regex}; return $value if !$regex or $value =~ /$regex/; # field is valid -- 2.11.0