Skip to content

Commit 795dcb5

Browse files
authored
Update class-mf2.php to flatten the haystack
Fixes #482
1 parent 0259d51 commit 795dcb5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

includes/Handler/class-mf2.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,11 @@ public function compare_urls( $needle, $haystack, $schemeless = true ) {
589589
$needle = array( $needle );
590590
}
591591

592+
// Flatten the haystack to ensure it only contains strings
593+
$haystack = array_filter($haystack, function($element) {
594+
return is_string($element) && !is_array($element);
595+
});
596+
592597
// Compare both arrays.
593598
return array_intersect( $needle, $haystack );
594599
}

0 commit comments

Comments
 (0)