Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,16 @@ public function get_item_permissions_check( $request ) {
}

if ( $post && ! empty( $request['password'] ) ) {

// Check if post password is string.
if ( ! is_string( $request['password'] ) ) {
return new WP_Error(
'rest_invalid_type',
__( 'Post password should be string.' ),
array( 'status' => 400 )
);
}

// Check post password, and return error if invalid.
if ( ! hash_equals( $post->post_password, $request['password'] ) ) {
return new WP_Error(
Expand Down