WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/14/2016 03:33:06 PM (4 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.

File:
1 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'];
Note: See TracChangeset for help on using the changeset viewer.