indieweb / mention-client-php

Client library for sending webmention and pingback notifications
https://indieweb.org/webmention
97 stars 19 forks source link

discoverWebmentionEndpoint returns nothing if link (in HTML) not enclosed in quotes #38

Open janboddez opened 4 years ago

janboddez commented 4 years ago

I've got this case where an endpoint ( <link rel=webmention href=[URL]> in the page's HTML) is not discovered if not explicitly wrapped in (double?) quotes.

Not yet sure if an issue with this library (although it seems like it could improve in this regard, too) or the mf2/mf2 parser, which I'm including, too ...

pfefferle commented 4 years ago

@janboddez is this valid HTML? I think the quotes (single or double) are required.

jlelse commented 4 years ago

@pfefferle It is valid: https://validator.w3.org/nu/?doc=https%3A%2F%2Fjlelse.blog%2F

pfefferle commented 4 years ago

@jlelse hmmm, you are right... so please forget my comment

(I also checked your page with the Webmention WordPress plugin and it seems to work fine... 😁 )

janboddez commented 4 years ago

Yeah, I noticed you're using DOMXPath there, which I might do as well. (Although DOMDocument doesn't always work as intended either, IMHO, it'll probably do in this case.) Still, the regex in this library, and possibly mf2 (which I haven't yet looked into), could probably be improved, too.