Today we had a problem using the room_admins emails, when more than one email was present.
Adding a new value to the list of room admin emails resulted in only the first (and possibly the last) email being valid as a room admin.
clean_address_list()
takes a comma separated strings, explodes it into an array, where it should trim the individual array entries and implode it using ",<blank>" as the separating string. The latter is important in is_book_admin, where ",<blank>" is used to explode the string again in an array whose entries should then be already trim'med .</blank></blank>
However, since clean_address_list()
uses
array_walk($array, 'trim');
trimming the individual entries fails as discussed here:
https://stackoverflow.com/questions/14828764/why-wont-trim-work-as-a-callback-for-array-walk-or-array-map-in-php
The result is, that entering first
"user1@mail.com,user2@mail.com
"
leads to a value for list of:
"user1@mail.com, user2@mail.com
"
then adding
"user1@mail.com, user2@mail.com,user3@mail.com
"
leads to
"user1@mail.com, user2@mail.com, user3@mail.com
"
where user2@mail.com
is separated by to consecutive blanks (was not trimmed and difficult to display here) and after exploding in is_book_admin()
has a leading blank.
Attached is a patch to solve the issue, by using `array_map()` instead.
Thanks. Now fixed in 2e4fcb8.