Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

#4305 closed defect (bug) (fixed)

Numeric Usernames and Private Messaging Bug

Reported by: robl987's profile Robl987 Owned by:
Milestone: 1.7 Priority: normal
Severity: normal Version: 1.5
Component: Messages Keywords: commit
Cc:

Description

I have posted this on the forums and been told this is likely a bug so I have been told to post it here.

I am currently developing a buddypress website where the login username is a 7 digit number. I have installed a fresh copy of the latest version of buddypress (1.5.6) and Wordpress (3.4).

What I have found that if I private message a member whos login user name is not purely numeric it works fine and the message is sent. If I try to send a message to a member with a pure numeric login username such as 345 or 2433222 it doesn’t matter the length of the number I get a red box at the top of the private message form with the message “There was an error sending that message, please try again”.

Members with a numeric username can send message fine aswell. Whats weird is if they start the private message conversation the the reply functionality works fine with a numeric username.

Many Thanks,

Rob

Attachments (1)

4305.01.patch (1.1 KB) - added by r-a-y 12 years ago.

Download all attachments as: .zip

Change History (5)

@r-a-y
12 years ago

#1 @r-a-y
12 years ago

  • Keywords has-patch added
  • Version changed from 1.5.6 to 1.5

Confirmed. Although you cannot create a username with only numbers on the frontend registration page, you can create numeric usernames in the backend or if the site already uses numeric usernames via LDAP or some other login system.

Attached is a patch against r6198; I think this bug should be addressed for BP 1.6.

You can probably get rid of the "bp_is_username_compatibility_mode()" check, but I left it in just in case of fringe cases!

#2 @boonebgorges
12 years ago

  • Keywords dev-feedback added

This fix looks good. Not a regression, so I'm not sure whether it's sensible to put it in at this point in the dev cycle. Other core devs, do you have any objection?

#3 @DJPaul
12 years ago

  • Keywords commit added; has-patch dev-feedback removed
  • Milestone changed from Awaiting Review to 1.7

Let's get this committed.

#4 @r-a-y
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [6340]) Fix messages_new_message() so numeric usernames get parsed properly.

Previously to this commit, numeric recipients were being checked
against the user ID column with bp_core_get_core_userdata() only.

This was considered okay since you cannot create a username with only
numbers on the BP frontend registration page. However, you can create
numeric usernames in the WP backend or if the site already uses
numeric usernames via LDAP or some other login system.

So, this commit also checks against user_login / user_nicename with
bp_core_get_userid() / bp_core_get_userid_from_nicename() as well to
be considerate to those use cases.

Fixes #4305.

Note: See TracTickets for help on using tickets.