Skip to content

Commit d88933d

Browse files
committed
Add inline comment explaining the is_array() check.
1 parent e060139 commit d88933d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/wp-includes/rest-api.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3428,6 +3428,7 @@ function rest_convert_error_to_response( $error ) {
34283428
$status = array_reduce(
34293429
$error->get_all_error_data(),
34303430
static function ( $status, $error_data ) {
3431+
// Note: $error_data may not be an array (e.g. stdClass), so is_array() check is intentional.
34313432
return is_array( $error_data ) && isset( $error_data['status'] ) ? $error_data['status'] : $status;
34323433
},
34333434
500

0 commit comments

Comments
 (0)