Bugzilla – Attachment 39991 Details for
Bug 8000
Test mode for notices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8000 - Updated the remaining email validation to Email::Valid .
Bug-8000---Updated-the-remaining-email-validation-.patch (text/plain), 5.04 KB, created by
Maxime Beaulieu
on 2015-06-08 13:32:53 UTC
(
hide
)
Description:
Bug 8000 - Updated the remaining email validation to Email::Valid .
Filename:
MIME Type:
Creator:
Maxime Beaulieu
Created:
2015-06-08 13:32:53 UTC
Size:
5.04 KB
patch
obsolete
>From 6c1ea8c91e9391385b5557d70a83f6ed498a2045 Mon Sep 17 00:00:00 2001 >From: mxbeaulieu <maxime.beaulieu@inlibro.com> >Date: Mon, 8 Jun 2015 08:34:46 -0400 >Subject: [PATCH] Bug 8000 - Updated the remaining email validation to > Email::Valid . > >Replaced the "=~ @" validation with Email::Valid->address(); >--- > C4/Letters.pm | 2 +- > basket/sendbasket.pl | 3 ++- > misc/cronjobs/runreport.pl | 3 ++- > opac/opac-sendbasket.pl | 3 ++- > opac/opac-sendshelf.pl | 3 ++- > virtualshelves/sendshelf.pl | 3 ++- > 6 files changed, 11 insertions(+), 6 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 5e1fc58..a54fff5 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -524,7 +524,7 @@ sub SendAlerts { > my $emailsTo = join( ',', @email); > my $emailsCC = join( ',', @cc); > my $sendAllEmailsTo = C4::Context->preference('SendAllEmailsTo'); >- # some validation. This could be improved. >+ > if ($sendAllEmailsTo && Email::Valid->address($sendAllEmailsTo) ) { > $emailsTo = $sendAllEmailsTo; > $emailsCC = ''; >diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl >index 64e6b28..fca85d3 100755 >--- a/basket/sendbasket.pl >+++ b/basket/sendbasket.pl >@@ -31,6 +31,7 @@ use C4::Auth; > use C4::Output; > use C4::Biblio; > use Koha::Email; >+use Email::Valid; > > my $query = new CGI; > >@@ -47,7 +48,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( > my $bib_list = $query->param('bib_list'); > my $sendAllEmailsTo = C4::Context->preference('SendAllEmailsTo'); > my $email_add = $query->param('email_add'); >-$email_add = $sendAllEmailsTo if ($sendAllEmailsTo && $sendAllEmailsTo =~ /@/ ); # some validation. This could be improved. >+$email_add = $sendAllEmailsTo if ($sendAllEmailsTo && Email::Valid->address($sendAllEmailsTo) ); > my $email_sender = $query->param('email_sender'); > > my $dbh = C4::Context->dbh; >diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl >index 2958411..401260c 100755 >--- a/misc/cronjobs/runreport.pl >+++ b/misc/cronjobs/runreport.pl >@@ -33,6 +33,7 @@ use Text::CSV_XS; > use CGI qw ( -utf8 ); > use Carp; > use Encode; >+use Email::Valid; > > use vars qw($VERSION); > >@@ -208,7 +209,7 @@ if ($to or $from or $email) { > $to or $to = C4::Context->preference('KohaAdminEmailAddress'); > } > my $sendAllEmailsTo = C4::Context->preference('SendAllEmailsTo'); >-$to = $sendAllEmailsTo if ($sendAllEmailsTo && $sendAllEmailsTo =~ /@/ ); # some validation. This could be improved. >+$to = $sendAllEmailsTo if ($sendAllEmailsTo && Email::Valid->address($sendAllEmailsTo) ); > > unless (scalar(@ARGV)) { > print STDERR "ERROR: No reportID(s) specified\n"; >diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl >index 32e612b..c38c769 100755 >--- a/opac/opac-sendbasket.pl >+++ b/opac/opac-sendbasket.pl >@@ -34,6 +34,7 @@ use C4::Output; > use C4::Biblio; > use C4::Members; > use Koha::Email; >+use Email::Valid; > > my $query = new CGI; > >@@ -50,7 +51,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( > my $bib_list = $query->param('bib_list'); > my $sendAllEmailsTo = C4::Context->preference('SendAllEmailsTo'); > my $email_add = $query->param('email_add'); >-$email_add = $sendAllEmailsTo if ($sendAllEmailsTo && $sendAllEmailsTo =~ /@/ ); # some validation. This could be improved. >+$email_add = $sendAllEmailsTo if ($sendAllEmailsTo && Email::Valid->address($sendAllEmailsTo) ); > my $email_sender = $query->param('email_sender'); > > my $dbh = C4::Context->dbh; >diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl >index 5b15fec..eefcdbb 100755 >--- a/opac/opac-sendshelf.pl >+++ b/opac/opac-sendshelf.pl >@@ -34,6 +34,7 @@ use C4::Output; > use C4::VirtualShelves; > use C4::Members; > use Koha::Email; >+use Email::Valid; > > my $query = new CGI; > >@@ -50,7 +51,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( > my $shelfid = $query->param('shelfid'); > my $sendAllEmailsTo = C4::Context->preference('SendAllEmailsTo'); > my $email = $query->param('email'); >-$email = $sendAllEmailsTo if ($sendAllEmailsTo && $sendAllEmailsTo =~ /@/ ); # some validation. This could be improved. >+$email = $sendAllEmailsTo if ($sendAllEmailsTo && Email::Valid->address($sendAllEmailsTo) ); > > my $dbh = C4::Context->dbh; > >diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl >index 8c27811..bc783da 100755 >--- a/virtualshelves/sendshelf.pl >+++ b/virtualshelves/sendshelf.pl >@@ -33,6 +33,7 @@ use C4::Items; > use C4::Output; > use C4::VirtualShelves; > use Koha::Email; >+use Email::Valid; > > my $query = new CGI; > >@@ -49,7 +50,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > my $shelfid = $query->param('shelfid'); > my $sendAllEmailsTo = C4::Context->preference('SendAllEmailsTo'); > my $email = $query->param('email'); >-$email = $sendAllEmailsTo if ($sendAllEmailsTo && $sendAllEmailsTo =~ /@/ ); # some validation. This could be improved. >+$email = $sendAllEmailsTo if ($sendAllEmailsTo && Email::Valid->address($sendAllEmailsTo) ); > > my $dbh = C4::Context->dbh; > >-- >1.7.9.5
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 8000
:
21976
|
22315
|
24784
|
25917
|
25919
|
25920
|
25923
|
25924
|
25925
|
25926
|
25927
|
25928
|
25939
|
25950
|
25951
|
26446
|
37463
|
37464
|
37465
|
37466
|
37467
|
37468
|
37469
|
37472
|
37473
|
37474
|
37475
|
37476
|
37477
|
37478
|
37481
|
37482
|
37483
|
37484
|
37485
|
37486
|
37487
|
39985
|
39986
|
39987
|
39988
|
39989
|
39990
|
39991
|
39992
|
40215
|
40216
|
40217
|
40218
|
40219
|
40220
|
40221
|
40222
|
40223
|
40224
|
40225
|
40226
|
40227
|
40228
|
40229
|
40230
|
46354
|
46355
|
46356
|
46357
|
46358
|
46359
|
46360
|
46361
|
46362
|
49991
|
49992
|
49993
|
49998
|
49999
|
50000
|
55940
|
58434
|
62863
|
67155
|
70086
|
70087
|
70484
|
74110
|
74111
|
74848
|
80370
|
81487
|
81488
|
81589
|
81590
|
81591
|
84801
|
84802
|
84803
|
84804
|
84805
|
86861
|
86862
|
86863
|
86864
|
86865
|
88874
|
88875
|
88876
|
88877
|
88878
|
88879