Make WordPress Core


Ignore:
Timestamp:
01/09/2025 07:41:47 PM (6 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

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

    r59377 r59595  
    4949        );
    5050
    51         if ( ! empty( $_POST['log'] ) ) {
     51        if ( ! empty( $_POST['log'] ) && is_string( $_POST['log'] ) ) {
    5252            $credentials['user_login'] = wp_unslash( $_POST['log'] );
    5353        }
    54         if ( ! empty( $_POST['pwd'] ) ) {
     54        if ( ! empty( $_POST['pwd'] ) && is_string( $_POST['pwd'] ) ) {
    5555            $credentials['user_password'] = $_POST['pwd'];
    5656        }
Note: See TracChangeset for help on using the changeset viewer.