View | Details | Raw Unified | Return to bug 28870
Collapse All | Expand All

(-)a/about.pl (-1 / +2 lines)
Lines 24-29 use Modern::Perl; Link Here
24
24
25
use CGI qw ( -utf8 );
25
use CGI qw ( -utf8 );
26
use DateTime::TimeZone;
26
use DateTime::TimeZone;
27
use Email::Address;
27
use File::Slurp qw( read_file );
28
use File::Slurp qw( read_file );
28
use List::MoreUtils qw( any );
29
use List::MoreUtils qw( any );
29
use Module::Load::Conditional qw( can_load );
30
use Module::Load::Conditional qw( can_load );
Lines 192-198 my $warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist = ( $AnonymousPatr Link Here
192
193
193
my $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist = ( not $anonymous_patron and Koha::Patrons->search({ privacy => 2 })->count );
194
my $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist = ( not $anonymous_patron and Koha::Patrons->search({ privacy => 2 })->count );
194
195
195
my $warnPrefKohaAdminEmailAddress = not Email::Valid->address(C4::Context->preference('KohaAdminEmailAddress'));
196
my $warnPrefKohaAdminEmailAddress = C4::Context->preference('KohaAdminEmailAddress') !~ m/$Email::Address::mailbox/;
196
197
197
my $c = Koha::Items->filter_by_visible_in_opac->count;
198
my $c = Koha::Items->filter_by_visible_in_opac->count;
198
my @warnings = C4::Context->dbh->selectrow_array('SHOW WARNINGS');
199
my @warnings = C4::Context->dbh->selectrow_array('SHOW WARNINGS');
(-)a/cpanfile (-1 lines)
Lines 39-45 requires 'Email::Date', '1.103'; Link Here
39
requires 'Email::MessageID', '1.406';
39
requires 'Email::MessageID', '1.406';
40
requires 'Email::Sender', '1.300030';
40
requires 'Email::Sender', '1.300030';
41
requires 'Email::Stuffer', '0.014';
41
requires 'Email::Stuffer', '0.014';
42
requires 'Email::Valid', '0.190';
43
requires 'Exception::Class', '1.38';
42
requires 'Exception::Class', '1.38';
44
requires 'File::Slurp', '9999.13';
43
requires 'File::Slurp', '9999.13';
45
requires 'Font::TTF', '0.45';
44
requires 'Font::TTF', '0.45';
(-)a/members/memberentry.pl (-4 / +4 lines)
Lines 44-50 use Koha::Patron::Categories; Link Here
44
use Koha::Patron::HouseboundRole;
44
use Koha::Patron::HouseboundRole;
45
use Koha::Patron::HouseboundRoles;
45
use Koha::Patron::HouseboundRoles;
46
use Koha::Token;
46
use Koha::Token;
47
use Email::Valid;
47
use Email::Address;
48
use Koha::SMS::Providers;
48
use Koha::SMS::Providers;
49
49
50
my $input = CGI->new;
50
my $input = CGI->new;
Lines 386-398 if ($op eq 'save' || $op eq 'insert'){ Link Here
386
  my $emailalt = $input->param('B_email');
386
  my $emailalt = $input->param('B_email');
387
387
388
  if ($emailprimary) {
388
  if ($emailprimary) {
389
      push (@errors, "ERROR_bad_email") if (!Email::Valid->address($emailprimary));
389
      push (@errors, "ERROR_bad_email") if ($emailprimary !~ m/$Email::Address::mailbox/);
390
  }
390
  }
391
  if ($emailsecondary) {
391
  if ($emailsecondary) {
392
      push (@errors, "ERROR_bad_email_secondary") if (!Email::Valid->address($emailsecondary));
392
      push (@errors, "ERROR_bad_email_secondary") if ($emailsecondary !~ m/$Email::Address::mailbox/);
393
  }
393
  }
394
  if ($emailalt) {
394
  if ($emailalt) {
395
      push (@errors, "ERROR_bad_email_alternative") if (!Email::Valid->address($emailalt));
395
      push (@errors, "ERROR_bad_email_alternative") if ($emailalt !~ m/$Email::Address::mailbox/);
396
  }
396
  }
397
397
398
  if (C4::Context->preference('ExtendedPatronAttributes') and $input->param('setting_extended_patron_attributes')) {
398
  if (C4::Context->preference('ExtendedPatronAttributes') and $input->param('setting_extended_patron_attributes')) {
(-)a/opac/opac-memberentry.pl (-4 / +4 lines)
Lines 34-40 use Koha::Patron::Consent; Link Here
34
use Koha::Patron::Modification;
34
use Koha::Patron::Modification;
35
use Koha::Patron::Modifications;
35
use Koha::Patron::Modifications;
36
use C4::Scrubber;
36
use C4::Scrubber;
37
use Email::Valid;
37
use Email::Address;
38
use Koha::DateUtils qw( dt_from_string output_pref );
38
use Koha::DateUtils qw( dt_from_string output_pref );
39
use Koha::Libraries;
39
use Koha::Libraries;
40
use Koha::Patron::Attribute::Types;
40
use Koha::Patron::Attribute::Types;
Lines 439-445 sub CheckForInvalidFields { Link Here
439
    my $borrower = shift;
439
    my $borrower = shift;
440
    my @invalidFields;
440
    my @invalidFields;
441
    if ($borrower->{'email'}) {
441
    if ($borrower->{'email'}) {
442
        unless ( Email::Valid->address($borrower->{'email'}) ) {
442
        unless ( $borrower->{'email'} =~ m/$Email::Address::mailbox/ ) {
443
            push(@invalidFields, "email");
443
            push(@invalidFields, "email");
444
        } elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) {
444
        } elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) {
445
            my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited?
445
            my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited?
Lines 465-474 sub CheckForInvalidFields { Link Here
465
        delete $borrower->{'repeat_email'};
465
        delete $borrower->{'repeat_email'};
466
    }
466
    }
467
    if ($borrower->{'emailpro'}) {
467
    if ($borrower->{'emailpro'}) {
468
        push(@invalidFields, "emailpro") if (!Email::Valid->address($borrower->{'emailpro'}));
468
        push(@invalidFields, "emailpro") if ($borrower->{'emailpro'} !~ m/$Email::Address::mailbox/);
469
    }
469
    }
470
    if ($borrower->{'B_email'}) {
470
    if ($borrower->{'B_email'}) {
471
        push(@invalidFields, "B_email") if (!Email::Valid->address($borrower->{'B_email'}));
471
        push(@invalidFields, "B_email") if ($borrower->{'B_email'} !~ m/$Email::Address::mailbox/);
472
    }
472
    }
473
    if ( defined $borrower->{'password'}
473
    if ( defined $borrower->{'password'}
474
        and $borrower->{'password'} ne $borrower->{'password2'} )
474
        and $borrower->{'password'} ne $borrower->{'password2'} )
(-)a/opac/opac-shareshelf.pl (-9 / +2 lines)
Lines 25-31 use constant SHELVES_URL => Link Here
25
  '/cgi-bin/koha/opac-shelves.pl?display=privateshelves&viewshelf=';
25
  '/cgi-bin/koha/opac-shelves.pl?display=privateshelves&viewshelf=';
26
26
27
use CGI qw ( -utf8 );
27
use CGI qw ( -utf8 );
28
use Email::Valid;
28
use Email::Address;
29
29
30
use C4::Auth qw( get_template_and_user );
30
use C4::Auth qw( get_template_and_user );
31
use C4::Context;
31
use C4::Context;
Lines 195-201 sub process_addrlist { Link Here
195
    foreach my $a (@temp) {
195
    foreach my $a (@temp) {
196
        $a =~ s/^\s+//;
196
        $a =~ s/^\s+//;
197
        $a =~ s/\s+$//;
197
        $a =~ s/\s+$//;
198
        if ( IsEmailAddress($a) ) {
198
        if ( $a =~ m/$Email::Address::mailbox/ ) {
199
            push @appr_addr, $a;
199
            push @appr_addr, $a;
200
        }
200
        }
201
        else {
201
        else {
Lines 296-307 sub load_template_vars { Link Here
296
    );
296
    );
297
}
297
}
298
298
299
sub IsEmailAddress {
300
301
    #TODO candidate for a module?
302
    return Email::Valid->address( $_[0] ) ? 1 : 0;
303
}
304
305
sub randomlist {
299
sub randomlist {
306
300
307
    #uses rand, safe enough for this application but not for more sensitive data
301
    #uses rand, safe enough for this application but not for more sensitive data
308
- 

Return to bug 28870