Skip to content

Commit f8a00b4

Browse files
authored
Remove todo
This is using get_json_params() instead of get_params() because any URL query parameter would then be included among the params, so by just getting the params from the JSON body we avoid potential failures due to additional query parameters being injected into the request URL.
1 parent d4c9f40 commit f8a00b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/optimization-detective/storage/rest-api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ function od_handle_rest_request( WP_REST_Request $request ) {
174174
);
175175
}
176176

177-
$data = $request->get_json_params(); // TODO: Why not just get_params()?
177+
$data = $request->get_json_params();
178178
if ( ! is_array( $data ) ) {
179179
return new WP_Error(
180180
'missing_array_json_body',

0 commit comments

Comments
 (0)