Skip to content

Commit f6f05b7

Browse files
committed
added some sanitize_callbacks
1 parent f0867a9 commit f6f05b7

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

includes/rest/class-collection.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,9 @@ public static function request_parameters_for_replies() {
298298
);
299299

300300
$params['id'] = array(
301-
'required' => true,
302-
'type' => 'string',
301+
'required' => true,
302+
'type' => 'string',
303+
'sanitize_callback' => 'sanitize_text_field',
303304
);
304305

305306
return $params;

includes/rest/class-server.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ public static function request_parameter_order( $order, $request ) {
200200
return $order;
201201
}
202202

203-
$type = $request->get_method();
203+
$method = $request->get_method();
204204

205-
if ( WP_REST_Server::CREATABLE !== $type ) {
205+
if ( WP_REST_Server::CREATABLE !== $method ) {
206206
return $order;
207207
}
208208

includes/rest/class-webfinger.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ public static function request_parameters() {
8888
$params = array();
8989

9090
$params['resource'] = array(
91-
'required' => true,
92-
'type' => 'string',
93-
'pattern' => '^(acct:)|^(https?://)(.+)$',
91+
'required' => true,
92+
'type' => 'string',
93+
'pattern' => '^(acct:)|^(https?://)(.+)$',
94+
'sanitize_callback' => 'sanitize_text_field',
9495
);
9596

9697
return $params;

0 commit comments

Comments
 (0)