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::Spec;
28
use File::Spec;
28
use File::Slurp;
29
use File::Slurp;
29
use List::MoreUtils qw/ any /;
30
use List::MoreUtils qw/ any /;
Lines 198-204 my $warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist = ( $AnonymousPatr Link Here
198
199
199
my $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist = ( not $anonymous_patron and Koha::Patrons->search({ privacy => 2 })->count );
200
my $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist = ( not $anonymous_patron and Koha::Patrons->search({ privacy => 2 })->count );
200
201
201
my $warnPrefKohaAdminEmailAddress = not Email::Valid->address(C4::Context->preference('KohaAdminEmailAddress'));
202
my $warnPrefKohaAdminEmailAddress = C4::Context->preference('KohaAdminEmailAddress') !~ m/$Email::Address::mailbox/;
202
203
203
my $c = Koha::Items->filter_by_visible_in_opac->count;
204
my $c = Koha::Items->filter_by_visible_in_opac->count;
204
my @warnings = C4::Context->dbh->selectrow_array('SHOW WARNINGS');
205
my @warnings = C4::Context->dbh->selectrow_array('SHOW WARNINGS');
(-)a/cpanfile (-1 / +1 lines)
Lines 35-45 requires 'DateTime::Format::MySQL', '0.04'; Link Here
35
requires 'DateTime::TimeZone', '1.20';
35
requires 'DateTime::TimeZone', '1.20';
36
requires 'Digest::MD5', '2.36';
36
requires 'Digest::MD5', '2.36';
37
requires 'Digest::SHA', '5.43';
37
requires 'Digest::SHA', '5.43';
38
requires 'Email::Address', '>= 1.908';
38
requires 'Email::Date', '1.103';
39
requires 'Email::Date', '1.103';
39
requires 'Email::MessageID', '1.406';
40
requires 'Email::MessageID', '1.406';
40
requires 'Email::Sender', '1.300030';
41
requires 'Email::Sender', '1.300030';
41
requires 'Email::Stuffer', '0.014';
42
requires 'Email::Stuffer', '0.014';
42
requires 'Email::Valid', '0.190';
43
requires 'Exception::Class', '1.38';
43
requires 'Exception::Class', '1.38';
44
requires 'File::Slurp', '9999.13';
44
requires 'File::Slurp', '9999.13';
45
requires 'Font::TTF', '0.45';
45
requires 'Font::TTF', '0.45';
(-)a/members/memberentry.pl (-4 / +4 lines)
Lines 46-52 use Koha::Patron::Categories; Link Here
46
use Koha::Patron::HouseboundRole;
46
use Koha::Patron::HouseboundRole;
47
use Koha::Patron::HouseboundRoles;
47
use Koha::Patron::HouseboundRoles;
48
use Koha::Token;
48
use Koha::Token;
49
use Email::Valid;
49
use Email::Address;
50
use Koha::SMS::Providers;
50
use Koha::SMS::Providers;
51
51
52
use vars qw($debug);
52
use vars qw($debug);
Lines 400-412 if ($op eq 'save' || $op eq 'insert'){ Link Here
400
  my $emailalt = $input->param('B_email');
400
  my $emailalt = $input->param('B_email');
401
401
402
  if ($emailprimary) {
402
  if ($emailprimary) {
403
      push (@errors, "ERROR_bad_email") if (!Email::Valid->address($emailprimary));
403
      push (@errors, "ERROR_bad_email") if ($emailprimary !~ m/$Email::Address::mailbox/);
404
  }
404
  }
405
  if ($emailsecondary) {
405
  if ($emailsecondary) {
406
      push (@errors, "ERROR_bad_email_secondary") if (!Email::Valid->address($emailsecondary));
406
      push (@errors, "ERROR_bad_email_secondary") if ($emailsecondary !~ m/$Email::Address::mailbox/);
407
  }
407
  }
408
  if ($emailalt) {
408
  if ($emailalt) {
409
      push (@errors, "ERROR_bad_email_alternative") if (!Email::Valid->address($emailalt));
409
      push (@errors, "ERROR_bad_email_alternative") if ($emailalt !~ m/$Email::Address::mailbox/);
410
  }
410
  }
411
411
412
  if (C4::Context->preference('ExtendedPatronAttributes') and $input->param('setting_extended_patron_attributes')) {
412
  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;
38
use Koha::DateUtils;
39
use Koha::Libraries;
39
use Koha::Libraries;
40
use Koha::Patron::Attribute::Types;
40
use Koha::Patron::Attribute::Types;
Lines 445-451 sub CheckForInvalidFields { Link Here
445
    my $borrower = shift;
445
    my $borrower = shift;
446
    my @invalidFields;
446
    my @invalidFields;
447
    if ($borrower->{'email'}) {
447
    if ($borrower->{'email'}) {
448
        unless ( Email::Valid->address($borrower->{'email'}) ) {
448
        unless ( $borrower->{'email'} =~ m/$Email::Address::mailbox/ ) {
449
            push(@invalidFields, "email");
449
            push(@invalidFields, "email");
450
        } elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) {
450
        } elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) {
451
            my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited?
451
            my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited?
Lines 471-480 sub CheckForInvalidFields { Link Here
471
        delete $borrower->{'repeat_email'};
471
        delete $borrower->{'repeat_email'};
472
    }
472
    }
473
    if ($borrower->{'emailpro'}) {
473
    if ($borrower->{'emailpro'}) {
474
        push(@invalidFields, "emailpro") if (!Email::Valid->address($borrower->{'emailpro'}));
474
        push(@invalidFields, "emailpro") if ($borrower->{'emailpro'} !~ m/$Email::Address::mailbox/);
475
    }
475
    }
476
    if ($borrower->{'B_email'}) {
476
    if ($borrower->{'B_email'}) {
477
        push(@invalidFields, "B_email") if (!Email::Valid->address($borrower->{'B_email'}));
477
        push(@invalidFields, "B_email") if ($borrower->{'B_email'} !~ m/$Email::Address::mailbox/);
478
    }
478
    }
479
    if ( defined $borrower->{'password'}
479
    if ( defined $borrower->{'password'}
480
        and $borrower->{'password'} ne $borrower->{'password2'} )
480
        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;
30
use C4::Auth;
31
use C4::Context;
31
use C4::Context;
Lines 196-202 sub process_addrlist { Link Here
196
    foreach my $a (@temp) {
196
    foreach my $a (@temp) {
197
        $a =~ s/^\s+//;
197
        $a =~ s/^\s+//;
198
        $a =~ s/\s+$//;
198
        $a =~ s/\s+$//;
199
        if ( IsEmailAddress($a) ) {
199
        if ( $a =~ m/$Email::Address::mailbox/ ) {
200
            push @appr_addr, $a;
200
            push @appr_addr, $a;
201
        }
201
        }
202
        else {
202
        else {
Lines 297-308 sub load_template_vars { Link Here
297
    );
297
    );
298
}
298
}
299
299
300
sub IsEmailAddress {
301
302
    #TODO candidate for a module?
303
    return Email::Valid->address( $_[0] ) ? 1 : 0;
304
}
305
306
sub randomlist {
300
sub randomlist {
307
301
308
    #uses rand, safe enough for this application but not for more sensitive data
302
    #uses rand, safe enough for this application but not for more sensitive data
309
- 

Return to bug 28870