Changeset 47362
- Timestamp:
- 02/25/2020 03:32:27 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api.php
r47224 r47362 1251 1251 1252 1252 if ( 'object' === $args['type'] ) { 1253 if ( '' === $value ) { 1254 $value = array(); 1255 } 1256 1253 1257 if ( $value instanceof stdClass ) { 1254 1258 $value = (array) $value; -
trunk/tests/phpunit/tests/rest-api/rest-schema-sanitization.php
r46586 r47362 276 276 } 277 277 278 /** 279 * @ticket 42961 280 */ 281 public function test_type_object_accepts_empty_string() { 282 $this->assertEquals( array(), rest_sanitize_value_from_schema( '', array( 'type' => 'object' ) ) ); 283 } 284 278 285 public function test_type_unknown() { 279 286 $schema = array( -
trunk/tests/phpunit/tests/rest-api/rest-schema-validation.php
r46586 r47362 289 289 } 290 290 291 /** 292 * @ticket 42961 293 */ 294 public function test_type_object_allows_empty_string() { 295 $this->assertTrue( rest_validate_value_from_schema( '', array( 'type' => 'object' ) ) ); 296 } 297 291 298 public function test_type_unknown() { 292 299 $schema = array(
Note: See TracChangeset
for help on using the changeset viewer.