Opened 15 years ago
Closed 14 years ago
#2057 closed defect (bug) (fixed)
'@' in username makes mentions not work...
Reported by: | Zooney | Owned by: | |
---|---|---|---|
Milestone: | 1.5 | Priority: | minor |
Severity: | Version: | ||
Component: | Core | Keywords: | commit has-patch |
Cc: | Zooney |
Description
Having a username formatted like "smith.1@…" (i.e. a Shibboleth EPPN) makes the mention functionality not work...
Versions:
Wordpress 2.9.1
BuddyPress 1.2.1
Steps to reproduce:
1.)Create a user with name such as "smith.1@…"
2.)Attempt to mention this user using @smith.1@…
Mention will not be formatted as a link as it would be without the '@' in a username and mention will not work
Attachments (2)
Change History (13)
#3
@
14 years ago
- Component set to Core
I think I have more information about this one...
If BuddyPress is using the user_nicename column when formatting links and creating the "@username" link functionality, the solution to my particular problem may be an issue with the shibboleth plugin I've been using the create user accounts.
It turns out that this plugin stores an unsanitized user_nicename, if BuddyPress uses the user_nicename field when creating links, and I can clean up the user_nicename column in my database this would become a non-issue.
#4
@
14 years ago
I've checked and unfortunately this problem still persists when using a sanitized user_nicename
#5
@
14 years ago
Andy says above that this is not an easy fix, but when I tested the attached patch 2057-0.diff, which simply adds an @ to the bp_activity_at_name_filter() filter regex, it seemed to work OK.
Could I ask others to test this patch and/or to pitch with info on why it won't work?
#6
@
14 years ago
Will test later, but what about a scenario where there is a user "test", "@test" and you try to send a mention to @test, i.e. @@test?
#8
@
14 years ago
- Keywords dev-feedback commit added; has-patch needs-testing removed
- Priority changed from major to minor
That seems like more of an edge case than the original problem. (Can user_nicename start with '@' anyway?) My vote is to apply this patch and cross that bridge if we come to it.
#9
@
14 years ago
- Keywords needs-patch added; dev-feedback removed
I spent a few hours looking at this sort of issue the other day, and whilst the solution in the patch fixes the immediate problem, there are in some situations still problems with the links being parsed/added to the string in the activity stream content itself. Nothing stopping this going in for this specific issue, however.
This same regex is also used in a few other components, so probably better to keep them all consistent. Anyone fancy updating the patch? Easy props.
This is not a simple fix so I'm bumping it back to 1.2.3 to take a better look at it. @ symbols are actually not allowed in usernames unless you are using LDAP, so while it's important, the vast majority of users are not going to see the problem.