Skip to content

Commit

Permalink
Added safer fallback if not found for some reason
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabywalters committed Aug 28, 2013
1 parent b881fb6 commit 968d405
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/BarnabyWalters/Mf2/Functions.php
Expand Up @@ -178,6 +178,8 @@ function flattenMicroformats(array $mfs) {
elseif (isMicroformat($mfs))
$mfs = array($mfs);

$items = []

foreach ($mfs as $mf) {
$items[] = $mf;

Expand All @@ -192,7 +194,7 @@ function flattenMicroformats(array $mfs) {
}
}

return $items ?: [];
return $items;
}

function findMicroformatsByType(array $mfs, $name, $flatten = true) {
Expand Down

0 comments on commit 968d405

Please sign in to comment.