Login and Registration: Check that the $_POST values are strings in wp_signon().

This prevents a fatal error from `trim()` via `wp_authenticate()` if an array is passed instead.

Follow-up to [6643], [58093].

Props leedxw, audrasjb, SergeyBiryukov.
Fixes #62794.
Built from https://develop.svn.wordpress.org/trunk@59595


git-svn-id: http://core.svn.wordpress.org/trunk@58981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2025-01-09 19:43:23 +00:00
parent 0086f4ba40
commit 504d02539f
2 changed files with 3 additions and 3 deletions

View File

@ -48,10 +48,10 @@ function wp_signon( $credentials = array(), $secure_cookie = '' ) {
'remember' => false,
);
if ( ! empty( $_POST['log'] ) ) {
if ( ! empty( $_POST['log'] ) && is_string( $_POST['log'] ) ) {
$credentials['user_login'] = wp_unslash( $_POST['log'] );
}
if ( ! empty( $_POST['pwd'] ) ) {
if ( ! empty( $_POST['pwd'] ) && is_string( $_POST['pwd'] ) ) {
$credentials['user_password'] = $_POST['pwd'];
}
if ( ! empty( $_POST['rememberme'] ) ) {

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.8-alpha-59594';
$wp_version = '6.8-alpha-59595';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.