[wp-trac] [WordPress Trac] #39470: Login page redirects back to login page. Cause: wp_users table - ID column is case-sensitive

WordPress Trac noreply at wordpress.org
Wed Jan 4 18:15:37 UTC 2017


#39470: Login page redirects back to login page. Cause: wp_users table - ID column
is case-sensitive
------------------------------------+-----------------------------
 Reporter:  icanhazpython           |      Owner:
     Type:  defect (bug)            |     Status:  new
 Priority:  normal                  |  Milestone:  Awaiting Review
Component:  Login and Registration  |    Version:  4.1
 Severity:  normal                  |   Keywords:
  Focuses:                          |
------------------------------------+-----------------------------
 This is an odd one.

 Environment:
 Mysql: 5.7.17
 PHP: 5.6.29
 WP version: 4.1, also present in 4.7

 Some of my sites seem to have the ID column in the wp_users table as
 lowercase id. Now I'm not sure how they got this way and if they were
 always this way (have not checked source to see table creation specs), but
 through process of elimination I was able to track down that a lowercase
 ID field name causes the login page to break, whereas uppercase will allow
 it to work.

 Literally this will break it:
 ALTER TABLE wp_users
 CHANGE COLUMN id id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

 And this will fix it:
 ALTER TABLE wp_users
 CHANGE COLUMN id ID bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

 I saw some errors with debug mode on:  Undefined property: "stdClass::$ID"
 in wp-includes/user.php

 Now I understand that this may be a case of intentional design, but I have
 not done any manual editing of my table schema, so I think the decision to
 be particular in the case of the field names could be waiting to bite
 someone else.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39470>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list