Bugzilla – Attachment 62520 Details for
Bug 15702
Trim whitespace from patron details upon submission
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15702: Recommended Counter-patch
Bug-15702-Recommended-Counter-patch.patch (text/plain), 1.65 KB, created by
Mark Tompsett
on 2017-04-21 13:12:49 UTC
(
hide
)
Description:
Bug 15702: Recommended Counter-patch
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2017-04-21 13:12:49 UTC
Size:
1.65 KB
patch
obsolete
>From cb675d4757fa6d5c4f3f7d6961b5954ab9c9396e Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Thu, 19 Jan 2017 21:13:47 -0500 >Subject: [PATCH] Bug 15702: Recommended Counter-patch > >As per comment #7, this patch affects AddMember and ModMember. >The test plan should be the same as comment #6. >Secondary patch with tests still to come. >--- > C4/Members.pm | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > >diff --git a/C4/Members.pm b/C4/Members.pm >index ee10cc7..e68a6fa 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -355,6 +355,14 @@ true on success, or false on failure > > sub ModMember { > my (%data) = @_; >+ >+ # trim whitespace from data which has some non-whitespace in it. >+ foreach my $field_name (keys(%data)) { >+ if ( defined $data{$field_name} && $data{$field_name} =~ /\S/ ) { >+ $data{$field_name} =~ s/^\s*|\s*$//g; >+ } >+ } >+ > # test to know if you must update or not the borrower password > if (exists $data{password}) { > if ($data{password} eq '****' or $data{password} eq '') { >@@ -442,6 +450,13 @@ sub AddMember { > my $dbh = C4::Context->dbh; > my $schema = Koha::Database->new()->schema; > >+ # trim whitespace from data which has some non-whitespace in it. >+ foreach my $field_name (keys(%data)) { >+ if ( defined $data{$field_name} && $data{$field_name} =~ /\S/ ) { >+ $data{$field_name} =~ s/^\s*|\s*$//g; >+ } >+ } >+ > # generate a proper login if none provided > $data{'userid'} = Generate_Userid( $data{'borrowernumber'}, $data{'firstname'}, $data{'surname'} ) > if ( $data{'userid'} eq '' || !Check_Userid( $data{'userid'} ) ); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15702
:
47424
|
58717
|
58768
|
62519
|
62520
|
62527
|
62528
|
62613
|
62614