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.
Built from https://develop.svn.wordpress.org/trunk@37697


git-svn-id: http://core.svn.wordpress.org/trunk@37663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2016-06-14 15:34:29 +00:00
parent d4e1683d23
commit 7ddbbfec08
3 changed files with 4 additions and 2 deletions

View File

@ -27,6 +27,8 @@
*/
function wp_signon( $credentials = array(), $secure_cookie = '' ) {
if ( empty($credentials) ) {
$credentials = array(); // Back-compat for plugins passing an empty string.
if ( ! empty($_POST['log']) )
$credentials['user_login'] = $_POST['log'];
if ( ! empty($_POST['pwd']) )

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-alpha-37696';
$wp_version = '4.6-alpha-37697';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -790,7 +790,7 @@ default:
$reauth = empty($_REQUEST['reauth']) ? false : true;
$user = wp_signon( '', $secure_cookie );
$user = wp_signon( array(), $secure_cookie );
if ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
if ( headers_sent() ) {