[Koha-bugs] [Bug 25371] Koha::Email doesn't validate header data

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue May 5 08:44:26 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25371

--- Comment #2 from David Cook <dcook at prosentient.com.au> ---
At first, I thought this would be easy, as we could just use
Email::Valid->address() in Koha::Email, but it seems that we sometimes pass in
1 email address and sometimes we pass in multiple (with a range of separators).

Koha/Illrequest.pm seems multiple emails with separator ";" (by replacing null
bytes?)
basket/sendbasket.pl uses 1 email address (in theory)
C4/Letters.pm has a range of 1 or 1+ emails, and separates with a comma.
misc/cronjobs/runreport.pl looks like 1 email address
opac/opac-sendbasket.pl uses 1 email address (in theory)
opac/opac-sendshelf.pl uses 1 email address (in theory)
virtualshelves/sendshelf.pl

--

Off the top of my head, the way to do it would be to add a setter called
"add_to_address()" to Koha::Email, and add them one by one (and validate them
one by one).

But it's used across quite a few scripts, so that will be a pain to test. I
suppose it would be a pain in any case.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list