Skip to content

Commit e898af2

Browse files
mailto link: Email address is ARRAY(...)
The API returns inconsistently either an array or a string for author.email take the following examples: http://localhost:5000/v1/author/NEILB is indexed as "email" : "[email protected]" (locally) https://fastapi.metacpan.org/v1/author/NEILB is indexed as "email" : ["[email protected]"] https://fastapi.metacpan.org/v1/author/REHSACK is "email" : "[email protected]" So update the template logic to check first if an array email.0 Also first check for asciiname before name, which should prevent breakage in the mailto 'URI' for cases like: "asciiname" : "Audrey Tang" "name" : "☻ 唐鳳 ☺" I don't think any validation exits on the asciiname field to validate it is actually ascii, perhaps this needs to be added as a seperate ticket. Closes metacpan#2237
1 parent 4188bd7 commit e898af2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

root/inc/notification.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
END;
3232
IF NOTIFICATION.has_email;
3333
NOTIFICATION.mailto = MAILTO(
34-
(NOTIFICATION.email || author.email),
34+
(NOTIFICATION.email || author.email.0 || author.email),
3535
(NOTIFICATION.title _ ' <' _ NOTIFICATION.module _ '>') | url,
36-
NOTIFICATION.body((NOTIFICATION.name || author.name), NOTIFICATION.module) | url
36+
NOTIFICATION.body((NOTIFICATION.name || author.asciiname || author.name), NOTIFICATION.module) | url
3737
);
3838
END;
3939
%>

0 commit comments

Comments
 (0)