Ticket #38984: 38984.2.diff
File 38984.2.diff, 1.6 KB (added by , 8 years ago) |
---|
-
src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
1027 1027 * @return WP_Error|string The sanitized username, if valid, otherwise an error. 1028 1028 */ 1029 1029 public function check_username( $value, $request, $param ) { 1030 $username = (string) rest_sanitize_value_from_schema( $value, $request, $param );1030 $username = (string) $value; 1031 1031 1032 1032 if ( ! validate_username( $username ) ) { 1033 1033 return new WP_Error( 'rest_user_invalid_username', __( 'Username contains invalid characters.' ), array( 'status' => 400 ) ); … … 1056 1056 * @return WP_Error|string The sanitized password, if valid, otherwise an error. 1057 1057 */ 1058 1058 public function check_user_password( $value, $request, $param ) { 1059 $password = (string) rest_sanitize_value_from_schema( $value, $request, $param );1059 $password = (string) $value; 1060 1060 1061 1061 if ( empty( $password ) ) { 1062 1062 return new WP_Error( 'rest_user_invalid_password', __( 'Passwords cannot be empty.' ), array( 'status' => 400 ) ); -
src/wp-includes/rest-api.php
840 840 } 841 841 $args = $attributes['args'][ $param ]; 842 842 843 return rest_sanitize_value_from_schema( $value, $args , $param);843 return rest_sanitize_value_from_schema( $value, $args ); 844 844 } 845 845 846 846 /**