PlaidWeb / webmention.js

Client-side library for rendering webmentions from webmention.io
MIT License
112 stars 16 forks source link

Mishandling of empty name string #41

Closed aciccarello closed 2 years ago

aciccarello commented 2 years ago

I noticed that some reactions were coming through with a title of " liked". The author object was defined with empty string values json{ "type": "card", "name": "", "photo": "", "url": "" }

I believe the check for the author name should use an || operator rather than a nullish check. https://github.com/PlaidWeb/webmention.js/blob/72e4372ced19eaed06f51e16f6e13b3de8dd14a2/static/webmention.js#L206

fluffy-critter commented 2 years ago

Ah, you're right. That's a pretty easy fix at least.