Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

also look for "author" property on a top-level "h-feed" #4

Merged
merged 3 commits into from
Nov 14, 2022
Merged

Conversation

aaronpk
Copy link
Contributor

@aaronpk aaronpk commented Feb 14, 2014

let me know what you think of this

@@ -222,6 +231,7 @@ function flattenMicroformats(array $mfs) {

function findMicroformatsByType(array $mfs, $name, $flatten = true) {
return findMicroformatsByCallable($mfs, function ($mf) use ($name) {
if(!array_key_exists('type', $mf)) return false;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this protecting against? A microformat structure iterated over by findMicroformatsByCallable should never not have a type key. If you’ve come across a situation where that does happen, please let me know where so I can fix it!

Also, this sort of check is what isMicroformat(array $mightBeAMicroformat) is for.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's just me being overly cautious about stuff. I've removed it from the PR.

@barnabywalters
Copy link
Owner

Thanks for the PR! Good catch, I can’t believe this wasn’t already in there :)

Apart from the query raised above, this looks good to me. I’m currently on the fence about whether to put network IO side-effect creating stuff in php-mf-cleaner to enable a full authorship implementation, or to put it in another package. For the moment it can live in here.

@aaronpk
Copy link
Contributor Author

aaronpk commented Feb 23, 2014

After you merge this can you do a new tag for packagist?

@barnabywalters barnabywalters merged commit 727007f into barnabywalters:master Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants