Bugzilla – Attachment 124004 Details for
Bug 28870
Cart shipping fails because of Non-ASCII characters in display-name of reply-to address
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28870: Remove traces of Email::Valid
Bug-28870-Remove-traces-of-EmailValid.patch (text/plain), 5.59 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-08-20 21:41:21 UTC
(
hide
)
Description:
Bug 28870: Remove traces of Email::Valid
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-08-20 21:41:21 UTC
Size:
5.59 KB
patch
obsolete
>From 20754a99fd4060d2bda6347c75c7fc99c636b553 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 20 Aug 2021 18:37:37 -0300 >Subject: [PATCH] Bug 28870: Remove traces of Email::Valid > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > about.pl | 3 ++- > cpanfile | 1 - > members/memberentry.pl | 8 ++++---- > opac/opac-memberentry.pl | 8 ++++---- > opac/opac-shareshelf.pl | 10 ++-------- > 5 files changed, 12 insertions(+), 18 deletions(-) > >diff --git a/about.pl b/about.pl >index 0410feb1e95..f3db789d2fc 100755 >--- a/about.pl >+++ b/about.pl >@@ -24,6 +24,7 @@ use Modern::Perl; > > use CGI qw ( -utf8 ); > use DateTime::TimeZone; >+use Email::Address; > use File::Slurp qw( read_file ); > use List::MoreUtils qw( any ); > use Module::Load::Conditional qw( can_load ); >@@ -192,7 +193,7 @@ my $warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist = ( $AnonymousPatr > > my $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist = ( not $anonymous_patron and Koha::Patrons->search({ privacy => 2 })->count ); > >-my $warnPrefKohaAdminEmailAddress = not Email::Valid->address(C4::Context->preference('KohaAdminEmailAddress')); >+my $warnPrefKohaAdminEmailAddress = C4::Context->preference('KohaAdminEmailAddress') !~ m/$Email::Address::mailbox/; > > my $c = Koha::Items->filter_by_visible_in_opac->count; > my @warnings = C4::Context->dbh->selectrow_array('SHOW WARNINGS'); >diff --git a/cpanfile b/cpanfile >index 8aa37b55ea2..fe14b40a183 100644 >--- a/cpanfile >+++ b/cpanfile >@@ -39,7 +39,6 @@ requires 'Email::Date', '1.103'; > requires 'Email::MessageID', '1.406'; > requires 'Email::Sender', '1.300030'; > requires 'Email::Stuffer', '0.014'; >-requires 'Email::Valid', '0.190'; > requires 'Exception::Class', '1.38'; > requires 'File::Slurp', '9999.13'; > requires 'Font::TTF', '0.45'; >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 5844b9c3f90..eda147c000c 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -44,7 +44,7 @@ use Koha::Patron::Categories; > use Koha::Patron::HouseboundRole; > use Koha::Patron::HouseboundRoles; > use Koha::Token; >-use Email::Valid; >+use Email::Address; > use Koha::SMS::Providers; > > my $input = CGI->new; >@@ -386,13 +386,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 ($emailprimary !~ m/$Email::Address::mailbox/); > } > if ($emailsecondary) { >- push (@errors, "ERROR_bad_email_secondary") if (!Email::Valid->address($emailsecondary)); >+ push (@errors, "ERROR_bad_email_secondary") if ($emailsecondary !~ m/$Email::Address::mailbox/); > } > if ($emailalt) { >- push (@errors, "ERROR_bad_email_alternative") if (!Email::Valid->address($emailalt)); >+ push (@errors, "ERROR_bad_email_alternative") if ($emailalt !~ m/$Email::Address::mailbox/); > } > > 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 8945cc339ba..5215394b96b 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -34,7 +34,7 @@ use Koha::Patron::Consent; > use Koha::Patron::Modification; > use Koha::Patron::Modifications; > use C4::Scrubber; >-use Email::Valid; >+use Email::Address; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Libraries; > use Koha::Patron::Attribute::Types; >@@ -439,7 +439,7 @@ sub CheckForInvalidFields { > my $borrower = shift; > my @invalidFields; > if ($borrower->{'email'}) { >- unless ( Email::Valid->address($borrower->{'email'}) ) { >+ unless ( $borrower->{'email'} =~ m/$Email::Address::mailbox/ ) { > push(@invalidFields, "email"); > } elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) { > my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited? >@@ -465,10 +465,10 @@ sub CheckForInvalidFields { > delete $borrower->{'repeat_email'}; > } > if ($borrower->{'emailpro'}) { >- push(@invalidFields, "emailpro") if (!Email::Valid->address($borrower->{'emailpro'})); >+ push(@invalidFields, "emailpro") if ($borrower->{'emailpro'} !~ m/$Email::Address::mailbox/); > } > if ($borrower->{'B_email'}) { >- push(@invalidFields, "B_email") if (!Email::Valid->address($borrower->{'B_email'})); >+ push(@invalidFields, "B_email") if ($borrower->{'B_email'} !~ m/$Email::Address::mailbox/); > } > if ( defined $borrower->{'password'} > and $borrower->{'password'} ne $borrower->{'password2'} ) >diff --git a/opac/opac-shareshelf.pl b/opac/opac-shareshelf.pl >index 701871bafcd..8bb7b606162 100755 >--- a/opac/opac-shareshelf.pl >+++ b/opac/opac-shareshelf.pl >@@ -25,7 +25,7 @@ use constant SHELVES_URL => > '/cgi-bin/koha/opac-shelves.pl?display=privateshelves&viewshelf='; > > use CGI qw ( -utf8 ); >-use Email::Valid; >+use Email::Address; > > use C4::Auth qw( get_template_and_user ); > use C4::Context; >@@ -195,7 +195,7 @@ sub process_addrlist { > foreach my $a (@temp) { > $a =~ s/^\s+//; > $a =~ s/\s+$//; >- if ( IsEmailAddress($a) ) { >+ if ( $a =~ m/$Email::Address::mailbox/ ) { > push @appr_addr, $a; > } > else { >@@ -296,12 +296,6 @@ sub load_template_vars { > ); > } > >-sub IsEmailAddress { >- >- #TODO candidate for a module? >- return Email::Valid->address( $_[0] ) ? 1 : 0; >-} >- > sub randomlist { > > #uses rand, safe enough for this application but not for more sensitive data >-- >2.33.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 28870
:
124002
|
124003
|
124004
|
124117
|
124118
|
124119
|
124178
|
124179
|
124180
|
124183
|
124184
|
124185
|
124752
|
124753
|
124754
|
124755
|
124756
|
124757
|
124762
|
124763
|
124764
|
124765
|
124766
|
124767
|
127521
|
127522
|
127523
|
127524
|
127525
|
127526
|
127745
|
127746
|
127747
|
127748
|
127749
|
127750