Bugzilla – Attachment 118622 Details for
Bug 28017
Allow non-FQDN and IP addresses in emails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28017: (follow-up) Make controller scripts use -fqdn as well
Bug-28017-follow-up-Make-controller-scripts-use--f.patch (text/plain), 3.58 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-03-22 17:56:42 UTC
(
hide
)
Description:
Bug 28017: (follow-up) Make controller scripts use -fqdn as well
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-03-22 17:56:42 UTC
Size:
3.58 KB
patch
obsolete
>From 93da38dd034f98e3445c417227532222bf4bf3fc Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 22 Mar 2021 14:49:47 -0300 >Subject: [PATCH] Bug 28017: (follow-up) Make controller scripts use -fqdn as > well > >This patch makes the *memberentry.pl scripts use the -fqdn flag as well. >This is to allow setting the @localhost addresses. > >I'm not sure about the need for this patch, as we shouldn't probably >allow end-users to use such addresses, and for testing purposes we can >set things on the DB. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > members/memberentry.pl | 6 +++--- > opac/opac-memberentry.pl | 6 +++--- > opac/opac-shareshelf.pl | 2 +- > 3 files changed, 7 insertions(+), 7 deletions(-) > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index e6be7854a07..88ec9bb9067 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -397,13 +397,13 @@ if ($op eq 'save' || $op eq 'insert'){ > my $emailalt = $input->param('B_email'); > > if ($emailprimary) { >- push (@errors, "ERROR_bad_email") if (!Email::Valid->address($emailprimary)); >+ push (@errors, "ERROR_bad_email") if (!Email::Valid->address(-address => $emailprimary, -fqdn => 0)); > } > if ($emailsecondary) { >- push (@errors, "ERROR_bad_email_secondary") if (!Email::Valid->address($emailsecondary)); >+ push (@errors, "ERROR_bad_email_secondary") if (!Email::Valid->address(-address => $emailsecondary, fqdn => 0)); > } > if ($emailalt) { >- push (@errors, "ERROR_bad_email_alternative") if (!Email::Valid->address($emailalt)); >+ push (@errors, "ERROR_bad_email_alternative") if (!Email::Valid->address(-address => $emailalt, fqdn => 0)); > } > > if (C4::Context->preference('ExtendedPatronAttributes') and $input->param('setting_extended_patron_attributes')) { >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index dbfd6f83dd2..a38a0dbe4a6 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -440,7 +440,7 @@ sub CheckForInvalidFields { > my $borrower = shift; > my @invalidFields; > if ($borrower->{'email'}) { >- unless ( Email::Valid->address($borrower->{'email'}) ) { >+ unless ( Email::Valid->address(-address => $borrower->{'email'}, fqdn => 0) ) { > push(@invalidFields, "email"); > } elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) { > my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited? >@@ -466,10 +466,10 @@ sub CheckForInvalidFields { > delete $borrower->{'repeat_email'}; > } > if ($borrower->{'emailpro'}) { >- push(@invalidFields, "emailpro") if (!Email::Valid->address($borrower->{'emailpro'})); >+ push(@invalidFields, "emailpro") if (!Email::Valid->address(-address => $borrower->{'emailpro'}, fqdn => 0)); > } > if ($borrower->{'B_email'}) { >- push(@invalidFields, "B_email") if (!Email::Valid->address($borrower->{'B_email'})); >+ push(@invalidFields, "B_email") if (!Email::Valid->address(-address => $borrower->{'B_email'}, fqdn => 0)); > } > if ( defined $borrower->{'password'} > and $borrower->{'password'} ne $borrower->{'password2'} ) >diff --git a/opac/opac-shareshelf.pl b/opac/opac-shareshelf.pl >index 7eecf6c45f3..2674d644c3f 100755 >--- a/opac/opac-shareshelf.pl >+++ b/opac/opac-shareshelf.pl >@@ -300,7 +300,7 @@ sub load_template_vars { > sub IsEmailAddress { > > #TODO candidate for a module? >- return Email::Valid->address( $_[0] ) ? 1 : 0; >+ return Email::Valid->address( -address => $_[0], -fqdn => 0 ) ? 1 : 0; > } > > sub randomlist { >-- >2.31.0
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 28017
:
118620
|
118621
|
118622
|
118644
|
118645
|
118646
|
118668
|
118696
|
118697
|
118698
|
119208