Bugzilla – Attachment 192181 Details for
Bug 37143
Patron registration allows for saving required fields with a single space instead of information
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37143: Do not allow required fields with only whitespace to be submitted
7e2f3a5.patch (text/plain), 1.22 KB, created by
David Nind
on 2026-01-29 18:20:04 UTC
(
hide
)
Description:
Bug 37143: Do not allow required fields with only whitespace to be submitted
Filename:
MIME Type:
Creator:
David Nind
Created:
2026-01-29 18:20:04 UTC
Size:
1.22 KB
patch
obsolete
>From 7e2f3a5c0dfe30d40e3e569da2e462dbe446a9f4 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 20 Jun 2024 15:27:11 +0000 >Subject: [PATCH] Bug 37143: Do not allow required fields with only whitespace > to be submitted > >To test: >1. Make some fields for OPAC self registration required. >2. Create a new patron via self reg. >3. Fill out those required fields as an empty string like " ". >4. Submit the form, it succeeds. >5. APPLY PATCH, restart_all >6. Try again. Required fields with only whitespace are treated as if they were empty. > >Signed-off-by: David Nind <david@davidnind.com> >--- > opac/opac-memberentry.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index 1daa2daf2c..8d654e8525 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -476,7 +476,7 @@ sub CheckMandatoryFields { > > foreach my $key ( keys %$mandatory_fields ) { > push( @empty_mandatory_fields, $key ) >- unless ( defined( $borrower->{$key} ) && $borrower->{$key} ); >+ unless ( defined( $borrower->{$key} ) && $borrower->{$key} && $borrower->{$key} !~ /^\s*$/ ); > } > > return @empty_mandatory_fields; >-- >2.39.5 >
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 37143
:
167936
|
192161
|
192179
|
192181
|
192191