janboddez / share-on-mastodon

Easily share WordPress posts on Mastodon.
https://jan.boddez.net/wordpress/share-on-mastodon
GNU General Public License v3.0
39 stars 5 forks source link

Default "excerpts" don't take HTML entities into account #89

Closed janboddez closed 10 months ago

janboddez commented 10 months ago

See https://indieweb.social/@janboddez/111075331718609311

janboddez commented 10 months ago

What happens is we first parse the template tags in a status, and then decode entities. But we run mb_substr() on the encoded version.

We gotta still decode at the end, though, because we fallback to the title if the parsed template is an empty string. Or we gotta decode that title before falling back to it.

janboddez commented 10 months ago

OK, that seems to work.