Skip to content

Commit 35d2f90

Browse files
authored
Merge pull request #483 from edent/patch-4
Update class-mf2.php to flatten the haystack
2 parents e3ceda3 + 99ba7d1 commit 35d2f90

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

includes/Handler/class-mf2.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,14 @@ 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(
594+
$haystack,
595+
function ( $element ) {
596+
return is_string( $element ) && ! is_array( $element );
597+
}
598+
);
599+
592600
// Compare both arrays.
593601
return array_intersect( $needle, $haystack );
594602
}

0 commit comments

Comments
 (0)