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 <berickxx@gmail.com>
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