Skip to content

Commit fd83d35

Browse files
committed
Ensure compatibility with PHP <8.2
1 parent 0970b43 commit fd83d35

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/wp-includes/rest-api/class-wp-rest-server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ public function resolve_route_handlers( string $route, array &$handlers ) {
10101010
}
10111011

10121012
// Resolve any just-in-time resolvable options, and apply defaults.
1013-
$handler = iterator_to_array( $handler );
1013+
$handler = is_array( $handler ) ? $handler : iterator_to_array( $handler );
10141014
$handler = wp_parse_args( $handler, $defaults );
10151015

10161016
// Allow comma-separated HTTP methods.

0 commit comments

Comments
 (0)