[Koha-bugs] [Bug 34432] New: Koha::Email->is_valid could be more strict

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jul 27 14:58:48 CEST 2023


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

            Bug ID: 34432
           Summary: Koha::Email->is_valid could be more strict
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: m.de.rooy at rijksmuseum.nl
        QA Contact: testopia at bugs.koha-community.org

We are using Email::Address->parse there. Which returns a list of
Email::Address objects for all email addresses found.
And if we receive something (altough changed), we return true.
But we generally just want to validate one address?

So this is all fine for Koha::Email:
    Koha::Email->is_valid('test1 at a.nl  '),
    Koha::Email->is_valid('  test1 at a.nl'),
    Koha::Email->is_valid('test1 at a.nl,test2 at b.nl'),

Note that the returned addresses are trimmed (and ignored).

This may not be a big deal for the interface btw, since we have HTML5
validation on email fields.
But could be a problem when coming from eg REST API and validation is just done
with is_valid.

-- 
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