Make WordPress Core


Ignore:
Timestamp:
12/01/2016 02:11:56 AM (7 years ago)
Author:
rachelbaker
Message:

REST API: Fix incorrect uses of rest_sanitize_value_from_schema().

In the check_username() and check_password() callbacks in the Users controller cast the provided request value to a string. The rest_sanitize_value_from_schema() function was being used incorrectly which was causing unintended request parsing.
In rest_sanitize_request_arg() do not pass nonexistent third parameter for the rest_sanitize_value_from_schema() function.

Props jnylen0, joehoyle, rachelbaker, ocean90.
Fixes #38984.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api.php

    r39329 r39400  
    841841    $args = $attributes['args'][ $param ];
    842842
    843     return rest_sanitize_value_from_schema( $value, $args, $param );
     843    return rest_sanitize_value_from_schema( $value, $args );
    844844}
    845845
Note: See TracChangeset for help on using the changeset viewer.