Make WordPress Core

Changeset 37697


Ignore:
Timestamp:
06/14/2016 03:33:06 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Users: wp_signon() expects an array as the $credentials argument, not a string.

If an empty string was passed, redeclare it as an empty array to avoid a warning and a fatal error in PHP 7.1.0 Alpha 1.

Props simonvik.
Fixes #37071.

Location:
trunk/src
Files:
2 edited

Legend:

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

    r37544 r37697  
    2828function wp_signon( $credentials = array(), $secure_cookie = '' ) {
    2929    if ( empty($credentials) ) {
     30        $credentials = array(); // Back-compat for plugins passing an empty string.
     31
    3032        if ( ! empty($_POST['log']) )
    3133            $credentials['user_login'] = $_POST['log'];
  • trunk/src/wp-login.php

    r37535 r37697  
    791791    $reauth = empty($_REQUEST['reauth']) ? false : true;
    792792
    793     $user = wp_signon( '', $secure_cookie );
     793    $user = wp_signon( array(), $secure_cookie );
    794794
    795795    if ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
Note: See TracChangeset for help on using the changeset viewer.