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 199-205 my $warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist = ( $AnonymousPatr Link Here
199
200
200
my $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist = ( not $anonymous_patron and Koha::Patrons->search({ privacy => 2 })->count );
201
my $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist = ( not $anonymous_patron and Koha::Patrons->search({ privacy => 2 })->count );
201
202
202
my $warnPrefKohaAdminEmailAddress = not Email::Valid->address(C4::Context->preference('KohaAdminEmailAddress'));
203
my $warnPrefKohaAdminEmailAddress = C4::Context->preference('KohaAdminEmailAddress') !~ m/$Email::Address::mailbox/;
203
204
204
my $c = Koha::Items->filter_by_visible_in_opac->count;
205
my $c = Koha::Items->filter_by_visible_in_opac->count;
205
my @warnings = C4::Context->dbh->selectrow_array('SHOW WARNINGS');
206
my @warnings = C4::Context->dbh->selectrow_array('SHOW WARNINGS');
(-)a/cpanfile (-1 / +1 lines)
Lines 34-44 requires 'DateTime::Format::MySQL', '0.04'; Link Here
34
requires 'DateTime::TimeZone', '1.20';
34
requires 'DateTime::TimeZone', '1.20';
35
requires 'Digest::MD5', '2.36';
35
requires 'Digest::MD5', '2.36';
36
requires 'Digest::SHA', '5.43';
36
requires 'Digest::SHA', '5.43';
37
requires 'Email::Address', '>= 1.908';
37
requires 'Email::Date', '1.103';
38
requires 'Email::Date', '1.103';
38
requires 'Email::MessageID', '1.406';
39
requires 'Email::MessageID', '1.406';
39
requires 'Email::Sender', '1.300030';
40
requires 'Email::Sender', '1.300030';
40
requires 'Email::Stuffer', '0.014';
41
requires 'Email::Stuffer', '0.014';
41
requires 'Email::Valid', '0.190';
42
requires 'Exception::Class', '1.38';
42
requires 'Exception::Class', '1.38';
43
requires 'File::Slurp', '9999.13';
43
requires 'File::Slurp', '9999.13';
44
requires 'Font::TTF', '0.45';
44
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 444-450 sub CheckForInvalidFields { Link Here
444
    my $borrower = shift;
444
    my $borrower = shift;
445
    my @invalidFields;
445
    my @invalidFields;
446
    if ($borrower->{'email'}) {
446
    if ($borrower->{'email'}) {
447
        unless ( Email::Valid->address($borrower->{'email'}) ) {
447
        unless ( $borrower->{'email'} =~ m/$Email::Address::mailbox/ ) {
448
            push(@invalidFields, "email");
448
            push(@invalidFields, "email");
449
        } elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) {
449
        } elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) {
450
            my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited?
450
            my $patrons_with_same_email = Koha::Patrons->search( # FIXME Should be search_limited?
Lines 470-479 sub CheckForInvalidFields { Link Here
470
        delete $borrower->{'repeat_email'};
470
        delete $borrower->{'repeat_email'};
471
    }
471
    }
472
    if ($borrower->{'emailpro'}) {
472
    if ($borrower->{'emailpro'}) {
473
        push(@invalidFields, "emailpro") if (!Email::Valid->address($borrower->{'emailpro'}));
473
        push(@invalidFields, "emailpro") if ($borrower->{'emailpro'} !~ m/$Email::Address::mailbox/);
474
    }
474
    }
475
    if ($borrower->{'B_email'}) {
475
    if ($borrower->{'B_email'}) {
476
        push(@invalidFields, "B_email") if (!Email::Valid->address($borrower->{'B_email'}));
476
        push(@invalidFields, "B_email") if ($borrower->{'B_email'} !~ m/$Email::Address::mailbox/);
477
    }
477
    }
478
    if ( defined $borrower->{'password'}
478
    if ( defined $borrower->{'password'}
479
        and $borrower->{'password'} ne $borrower->{'password2'} )
479
        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