Skip to content

Commit

Permalink
Resolve Redirect: Explicitly pass the parameter to be validated (#14538)
Browse files Browse the repository at this point in the history
In certain situations a second parameter was being passed to the
`validate_callback` of the resolve-redirect endpoint. This was causing
an exception depending on its value.

This change wraps the callback to ensure that only one parameter is
passed.
  • Loading branch information
pablinos authored Jan 31, 2020
1 parent 791a349 commit 18e4626
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public function register_routes() {
'description' => __( 'The URL to check for redirects.', 'jetpack' ),
'type' => 'string',
'required' => 'true',
'validate_callback' => 'wp_http_validate_url',
'validate_callback' => function ( $param ) {
return wp_http_validate_url( $param );
},
),
),
array(
Expand Down

0 comments on commit 18e4626

Please sign in to comment.