#37071 closed defect (bug) (fixed)
PHP 7.1.0 changed how they handle string vs array-indexes.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Users | Keywords: | has-patch |
Focuses: | Cc: |
Description
Login to wordpress fails with Warning: Illegal string offset 'user_login' under php 7.1.0 alpha 1.
wp-login.php sends an empty string to wp_signon that expects an array.
The following patch to wp-login.php seems to solves the issue:
@@ -790,7 +790,7 @@ function retrieve_password() {
$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() ) {
Attachments (1)
Change History (14)
#2
@
9 years ago
- Component changed from General to Users
- Milestone changed from Awaiting Review to 4.6
#4
@
9 years ago
Might make sense to fix this in wp_signon as well, just in case plugins copied core's implementation.
#6
@
9 years ago
From #37083:
[Mon Jun 13 00:24:29 2016] PHP Warning: Illegal string offset 'remember' in /tmp/wordpress/wp-includes/user.php on line 41 [Mon Jun 13 00:24:29 2016] PHP Stack trace: [Mon Jun 13 00:24:29 2016] PHP 1. {main}() /tmp/wordpress/router.php:0 [Mon Jun 13 00:24:29 2016] PHP 2. require_once() /tmp/wordpress/router.php:51 [Mon Jun 13 00:24:29 2016] PHP 3. wp_signon() /tmp/wordpress/wp-login.php:784 [Mon Jun 13 00:24:29 2016] PHP Warning: Cannot assign an empty string to a string offset in /tmp/wordpress/wp-includes/user.php on line 41 [Mon Jun 13 00:24:29 2016] PHP Stack trace: [Mon Jun 13 00:24:29 2016] PHP 1. {main}() /tmp/wordpress/router.php:0 [Mon Jun 13 00:24:29 2016] PHP 2. require_once() /tmp/wordpress/router.php:51 [Mon Jun 13 00:24:29 2016] PHP 3. wp_signon() /tmp/wordpress/wp-login.php:784 [Mon Jun 13 00:24:29 2016] PHP Warning: Illegal string offset 'user_login' in /tmp/wordpress/wp-includes/user.php on line 56 [Mon Jun 13 00:24:29 2016] PHP Stack trace: [Mon Jun 13 00:24:29 2016] PHP 1. {main}() /tmp/wordpress/router.php:0 [Mon Jun 13 00:24:29 2016] PHP 2. require_once() /tmp/wordpress/router.php:51 [Mon Jun 13 00:24:29 2016] PHP 3. wp_signon() /tmp/wordpress/wp-login.php:784 [Mon Jun 13 00:24:29 2016] PHP Fatal error: Uncaught Error: Cannot create references to/from string offsets in /tmp/wordpress/wp-includes/user.php:56
Moved here as it's all related.
#10
@
9 years ago
there are some failed external-http tests with a similar cause.
#12
@
9 years ago
- Resolution set to fixed
- Status changed from reopened to closed
Upstream ticket for the change: https://bugs.php.net/bug.php?id=53432
Tests are running fine with PHP 7.1.0alpha2, closing as fixed. Feel free to reopen if you find another case which needs to be fixed.
Note: See
TracTickets for help on using
tickets.
Attached patch that might solve the issue.