Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remote Operation get_user on Numeric Usernames #498

Closed
jaswrks opened this issue Mar 2, 2015 · 1 comment
Closed

Remote Operation get_user on Numeric Usernames #498

jaswrks opened this issue Mar 2, 2015 · 1 comment
Assignees
Milestone

Comments

@jaswrks
Copy link
Contributor

jaswrks commented Mar 2, 2015

Referencing this line of code in s2Member Pro.

If a remote API call is made to find a user by user_login, and that username is_numeric(), the WP_User class will treat it like a user ID instead of as an actual username.

Solution: Use new WP_User(0, [user login]) as the second argument to the constructor. Thereby forcing WP_User to consider it a username, even if it is all numeric.

@jaswrks jaswrks self-assigned this Mar 2, 2015
jaswrks pushed a commit that referenced this issue Mar 2, 2015
Bug fix. `get_user` API call to work with all numeric usernames. See: #498
jaswrks pushed a commit to wpsharks/s2member-pro that referenced this issue Mar 2, 2015
Bug fix. `get_user` API call to work with all numeric usernames. See: wpsharks/s2member#498
@jaswrks jaswrks added this to the Future Release milestone Mar 2, 2015
@jaswrks
Copy link
Contributor Author

jaswrks commented Mar 2, 2015

Next Release Changelog:

  • (s2Member Pro) Remote Operations API (Bug Fix): If a remote API call was made to find a user by user_login, and that username was all numeric, the WP_User class treated it like a user ID instead of as an actual username. Resolved in this release by calling new WP_User(0, [user login]) as the second argument to the constructor. Thereby forcing WP_User to consider it a username. See also this GitHub issue if you'd like technical details.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant