Skip to content

Commit d046fb8

Browse files
authored
Merge pull request #38 from WP-API/fix-slashing
Avoid double-slashing
2 parents 30ff08c + bec344b commit d046fb8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

inc/admin/namespace.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,17 @@ function validate_parameters( $params ) {
153153
if ( empty( $params['name'] ) ) {
154154
return new WP_Error( 'rest_oauth2_missing_name', __( 'Client name is required', 'oauth2' ) );
155155
}
156-
$valid['name'] = wp_filter_post_kses( $params['name'] );
156+
$valid['name'] = wp_kses_post( $params['name'] );
157157

158158
if ( empty( $params['description'] ) ) {
159159
return new WP_Error( 'rest_oauth2_missing_description', __( 'Client description is required', 'oauth2' ) );
160160
}
161-
$valid['description'] = wp_filter_post_kses( $params['description'] );
161+
$valid['description'] = wp_kses_post( $params['description'] );
162162

163163
if ( empty( $params['type'] ) ) {
164164
return new WP_Error( 'rest_oauth2_missing_type', __( 'Type is required.', 'oauth2' ) );
165165
}
166-
$valid['type'] = wp_filter_post_kses( $params['type'] );
166+
$valid['type'] = wp_kses_post( $params['type'] );
167167

168168
if ( empty( $params['callback'] ) ) {
169169
return new WP_Error( 'rest_oauth2_missing_callback', __( 'Client callback is required and must be a valid URL.', 'oauth2' ) );

0 commit comments

Comments
 (0)