fixes#118. as far as we can tell, this is probably the root cause of many of these bugs filed against webmention.io over the last couple years, https://github.com/aaronpk/webmention.io/issues , eg #188, #187, #175, #173, etc.
@aaronpk [said](https://chat.indieweb.org/dev/2023-08-07#t1691382116891200):
> That was apparently added 8 years ago
> i vaguely remember some old issue with appspot URLs that I had to work around
that appspot URL issue was probably that it required SNI for SSL, which was less supported then, and much more widely supported now, so I'm pretty sure this change is ok.
cc @osa_k
* Default options are applied to calls to parse(), rels(), feeds() and process()
* Default options are overridden by options passed to the respective function call on a
property-by-property basis
* Documented in README with example
* Added basic test (only for parse() behaviour)
* Also fixed a bug causing an error processing h-cards with no URL property
* Added isImgAlt static method to Formats\Mf2
* Used it in collectArrayURLValues and getPlaintext to handle cases where
img+alt structures are encountered
Additionally disabled reporting of deprecation warnings while testing for
a cleaner output. All tests are passing.
`strpos(string, sub)` returns `false` if `sub` is not present in `string`. In this case, we want to check if `sub` is not a *prefix* of `string`. Hence, we just need to test if the returned position is simply different from 0.
* looks through the full mf2 tree for step 7 of authorship https://github.com/indieweb/authorship/issues/2
* if no author h-card is found, falls back to returning the author URL without other data instead of missing author
closes#95
if the document contains a link to the target, but that link is not in the parsed result, don't return an error, but also don't return the parsed document
closes#150
To make it possible to consume feeds of pre-rendered Microformats2 JSON
data, we need to be able to discover that it is a Microformats2 JSON
file using the known MIME types documented in
http://microformats.org/wiki/microformats2-mime-type
Now it checks that:
1. h-geo exists
2. it's a microformat
3. it's of type "h-geo"
4. that it has properties
5. that it has latitude
6. that it has longitude
If all checks are true, lat and lon get replaced with values of h-geo object.
This adds h-geo microformat support. It's clunky but it should work. I'm no PHP gal so I hope you have CI or something that would test it.
Test case: [this post by me](https://fireburn.ru/posts/1567956895) that should contain a checkin with h-geo embedded. Should be parsed with latitude and longitude, showing a map in applications like Monocle.
The previous check removed a h-card, but this one still takes the first of the original array. Which means, in the case of `h-card+h-entry`, the h-card get’s removed, but then the if triggers and the `h-card` is selected.