id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses 45448,rest_sanitize_value_from_schema() returns invalid value when using a schema of type array with a null value,hogash,SergeyBiryukov,"When using the following configuration, you will get an array containing 1 empty string instead of an empty array; {{{ $schema = array( 'type' => 'array', 'items' => [ 'type' => 'string', ], ); $value = rest_sanitize_value_from_schema( null, $schema ); var_dump( $value ); }}} The solution for this would be to modify the following line in rest_sanitize_value_from_schema(): {{{ $value = preg_split( '/[\s,]+/', $value ); }}} with {{{ $value = preg_split( '/[\s,]+/', $value, null, PREG_SPLIT_NO_EMPTY ); }}} ",defect (bug),closed,normal,5.1,REST API,4.9.8,normal,fixed,has-patch needs-unit-tests,,rest-api