Changeset 60564
- Timestamp:
- 11/17/2025 10:58:27 AM (8 days ago)
- Location:
- branches/6.9/wp-includes
- Files:
-
- 3 edited
-
abilities.php (modified) (1 diff)
-
rest-api/endpoints/class-wp-rest-abilities-v1-list-controller.php (modified) (2 diffs)
-
version.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/6.9/wp-includes/abilities.php
r60411 r60564 221 221 'type' => 'string', 222 222 'description' => __( 'The database server vendor and version string reported by the driver.' ), 223 'examples' => array( '8.0.34', '10.11.6-MariaDB' ),224 223 ), 225 224 'wp_version' => array( -
branches/6.9/wp-includes/rest-api/endpoints/class-wp-rest-abilities-v1-list-controller.php
r60383 r60564 196 196 197 197 /** 198 * Normalizes schema empty object defaults. 199 * 200 * Converts empty array defaults to objects when the schema type is 'object' 201 * to ensure proper JSON serialization as {} instead of []. 202 * 203 * @since 6.9.0 204 * 205 * @param array<string, mixed> $schema The schema array. 206 * @return array<string, mixed> The normalized schema. 207 */ 208 private function normalize_schema_empty_object_defaults( array $schema ): array { 209 if ( isset( $schema['type'] ) && 'object' === $schema['type'] && isset( $schema['default'] ) ) { 210 $default = $schema['default']; 211 if ( is_array( $default ) && empty( $default ) ) { 212 $schema['default'] = (object) $default; 213 } 214 } 215 return $schema; 216 } 217 218 /** 198 219 * Prepares an ability for response. 199 220 * … … 210 231 'description' => $ability->get_description(), 211 232 'category' => $ability->get_category(), 212 'input_schema' => $ ability->get_input_schema(),213 'output_schema' => $ ability->get_output_schema(),233 'input_schema' => $this->normalize_schema_empty_object_defaults( $ability->get_input_schema() ), 234 'output_schema' => $this->normalize_schema_empty_object_defaults( $ability->get_output_schema() ), 214 235 'meta' => $ability->get_meta(), 215 236 ); -
branches/6.9/wp-includes/version.php
r60563 r60564 17 17 * @global string $wp_version 18 18 */ 19 $wp_version = '6.9-RC1-6125 1';19 $wp_version = '6.9-RC1-61252'; 20 20 21 21 /**
Note: See TracChangeset
for help on using the changeset viewer.