[wp-trac] [WordPress Trac] #37606: WP-Login - Line 784 wp_signon() function
WordPress Trac
noreply at wordpress.org
Mon Aug 8 21:24:34 UTC 2016
#37606: WP-Login - Line 784 wp_signon() function
------------------------------------+-----------------------------
Reporter: KyleWLawrence | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Login and Registration | Version: 4.5.3
Severity: normal | Keywords:
Focuses: administration |
------------------------------------+-----------------------------
Line 784 of wp-login utilizes the wp_signon() function as so:
{{{
$user = wp_signon( '', $secure_cookie );
}}}
However, it should be:
{{{
$user = wp_signon( array(), $secure_cookie );
}}}
The current way gives a 500 error on my server to someone trying to login.
The second way solves that problem. This is because the wp_signon function
wants an array if a variable is passed:
{{{
function wp_signon( $credentials = array(), $secure_cookie = '' ) {
if ( empty($credentials) ) {
if ( ! empty($_POST['log']) )
$credentials['user_login'] = $_POST['log'];
if ( ! empty($_POST['pwd']) )
$credentials['user_password'] = $_POST['pwd'];
if ( ! empty($_POST['rememberme']) )
$credentials['remember'] = $_POST['rememberme'];
}
if ( !empty($credentials['remember']) )
$credentials['remember'] = true;
else
$credentials['remember'] = false;
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37606>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list