Skip to content

Commit bb75e9a

Browse files
REST API: Change empty properties array to empty object for consistency
1 parent ab83cf7 commit bb75e9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/rest-api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ function rest_sanitize_schema_properties_recursive( $data ) {
243243

244244
// Convert empty properties array to empty object.
245245
if ( isset( $data_array['properties'] ) && is_array( $data_array['properties'] ) && empty( $data_array['properties'] ) ) {
246-
$data_array['properties'] = new stdClass();
246+
$data_array['properties'] = (object) array();
247247
}
248248

249249
// Process nested elements recursively.

0 commit comments

Comments
 (0)