]> git.koha-community.org Git - koha.git/commit
Bug 28870: Use Email::Address to validate email addresses
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 20 Aug 2021 21:23:30 +0000 (18:23 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 19 Nov 2021 20:41:49 +0000 (10:41 -1000)
commit6007c78690abd102fa030f3049c884de86c98c13
treef9c6f7aee22fe2e11a3e5def611e23b2d013145d
parent712d949b126c885155a846482a652f8f8b5a152c
Bug 28870: Use Email::Address to validate email addresses

This patch adds a new dependency, Email::Address. It is used in
Koha::Email to replace the current use of Email::Valid, which proved to
be problematic when it comes to UTF-8 characters.

Email::Address provides suitable regexes that -when used- keep our
tests passing, but also deal better with UTF-8 data.

To test:
1. Apply the regression tests patch
2. Notice the only change is that it tweaks a couple addresses so they
   contain umlauts and also have the "Description <address>" format that
   is used when sending carts.
3. Run:
   $ kshell
  k$ prove t/Koha/Email.t
=> FAIL: Tests fail! Things die because Email::Valid doesn't like the
   from we passed.
4. Run:
   $ sudo apt install libemail-address-perl
5. Apply this patch
6. Repeat 3
=> SUCCESS: Tests pass!
7. Try what is described in comment 1
=> SUCCESS: Things are back to normal
8. Sign off :-D
9. Send cookies

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 5d612707f017899f8b2152985a4fafdadbd2159a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/Email.pm