wordpress-develop/tests/phpunit/tests/rest-api
Felix Arntz 08564b5a80 General: Fix problematic string to array parsing.
WordPress has historically often used code like `preg_split( '/[\s,]+/', $var )` to parse a string of comma-separated values into an array. However, this approach was causing an empty string to not be parsed into an empty array as expected, but rather into an array with the empty string as its sole element.

This was among other areas causing problems in the REST API where passing an empty request parameter could cause that request to fail because, instead of it being ignored, that parameter would be compared against the valid values for it, which typically do not include an empty string.

Props david.binda, sstoqnov.
Fixes #43977.


git-svn-id: https://develop.svn.wordpress.org/trunk@44546 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-10 21:05:50 +00:00
..
rest-attachments-controller.php Tests: Replace uses of $this->server with rest_get_server(). 2018-12-16 18:53:58 +00:00
rest-autosaves-controller.php Tests: Replace use of $this->server with rest_get_server() in test_registered_query_params(). 2018-12-17 01:24:36 +00:00
rest-block-renderer-controller.php REST API: Preserve unknown, respect null in server-side block rendering. 2018-12-17 17:59:44 +00:00
rest-blocks-controller.php REST API: Always include title.raw/content.raw for Blocks in context=view. 2018-12-17 17:21:05 +00:00
rest-categories-controller.php Tests: Improve REST API tests for categories and tags. 2019-01-09 10:30:49 +00:00
rest-comments-controller.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:50:26 +00:00
rest-controller.php General: Fix problematic string to array parsing. 2019-01-10 21:05:50 +00:00
rest-pages-controller.php REST API: Include permalink_template/generated_slug for Posts 2018-12-12 02:11:22 +00:00
rest-post-meta-fields.php REST API: Slash existing meta values when comparing with incoming meta upates. 2018-12-13 16:29:57 +00:00
rest-post-statuses-controller.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:50:26 +00:00
rest-post-types-controller.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:50:26 +00:00
rest-posts-controller.php Query: Standardize treatment of 'orderby' values post__in, post_parent__in, and post_name__in. 2019-01-08 03:32:04 +00:00
rest-request-validation.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:50:26 +00:00
rest-request.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:50:26 +00:00
rest-revisions-controller.php Tests: Restore restapi group on WP_Test_REST_Revisions_Controller. 2018-09-18 03:44:57 +00:00
rest-schema-sanitization.php General: Fix problematic string to array parsing. 2019-01-10 21:05:50 +00:00
rest-schema-setup.php REST API: Avoid using 'parent' as path argument name for autosaves. 2018-12-17 00:23:55 +00:00
rest-schema-validation.php General: Fix problematic string to array parsing. 2019-01-10 21:05:50 +00:00
rest-search-controller.php REST API: Introduce controller for searching across post types. 2018-12-13 09:37:05 +00:00
rest-server.php Tests: Add missing public access modifier to Tests_REST_Server methods. 2018-09-23 15:45:02 +00:00
rest-settings-controller.php REST API: Remove permalink_structure from the REST API settings endpoint. 2019-01-08 02:50:05 +00:00
rest-tags-controller.php Tests: Improve REST API tests for categories and tags. 2019-01-09 10:30:49 +00:00
rest-taxonomies-controller.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:50:26 +00:00
rest-term-meta-fields.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:50:26 +00:00
rest-test-controller.php REST API: Don't add fields to object when not included in ?_fields=. 2018-12-12 20:50:22 +00:00
rest-themes-controller.php Themes: Introduce responsive embeds support. 2018-12-14 01:49:46 +00:00
rest-users-controller.php REST API: Introduce Autosaves controller and endpoint. 2018-12-13 22:41:47 +00:00