Skip to content

Commit

Permalink
Login and Registration: Check that post_password is a string in `wp…
Browse files Browse the repository at this point in the history
…-login.php`.

This prevents a fatal error if an array is passed instead.

Follow-up to [19925], [34909], [58023].

Props dd32, swissspidy.
Fixes #61136.

git-svn-id: https://develop.svn.wordpress.org/trunk@58093 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov authored and spacedmonkey committed May 4, 2024
1 parent ef229d9 commit 3b7e433
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-login.php
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ function wp_login_viewport_meta() {
break;

case 'postpass':
if ( ! array_key_exists( 'post_password', $_POST ) ) {
if ( ! isset( $_POST['post_password'] ) || ! is_string( $_POST['post_password'] ) ) {
wp_safe_redirect( wp_get_referer() );
exit;
}
Expand Down

0 comments on commit 3b7e433

Please sign in to comment.