[buddypress-trac] [BuddyPress] #5185: BP Signup - spaces in username issue
buddypress-trac
noreply at wordpress.org
Thu Oct 31 19:53:29 UTC 2013
#5185: BP Signup - spaces in username issue
--------------------------------------------+------------------
Reporter: hnla | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 1.9
Component: Core | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-testing commit |
--------------------------------------------+------------------
Comment (by boonebgorges):
I've done some more thinking and hacking related to this issue today.
Essentially, I'm going to reverse my opinion stated here:
> So, I'm going to suggest that, for the time being, we keep the behavior
the same as it is now - no spaces in usernames - but simply change how
that's enforced.
and I'm going to endorse r-a-y's original idea on #4622, which was to (a)
allow spaces in usernames when WP does, and (b) fix BuddyPress as
necessary so that usernames with spaces work.
5185.02.patch does a number of things. I would normally try to split these
up, but they're kinda interdependent, thus the single patch.
- In `bp_core_validate_user_signup()`, defer to
`wpmu_validate_user_signup()` if the latter function exists. This removes
all user validation responsibility from BuddyPress when using WordPress
Multisite (hooray!). In the case of non-Multisite, we continue to run our
own logic, which parallels WordPress's. (Non-MS WP does not have a handy
signup validation function like MS does. This is an oversight that should
be fixed upstream. Until then, we have to use our own function.)
- Remove `bp_core_strip_username_spaces()` - in other words, allow spaces
in usernames. Note that this only allows spaces if WP's rules allow. MS is
still very restrictive here, so if the user runs MS, spaces will still not
be allowed.
- In most cases, the change to allow spaces in user_login doesn't affect
BP. The exception is `BP_ENABLE_USERNAME_COMPATIBILITY_MODE`, which forces
us to use `user_login` instead of (the heavily-sanitized) `user_nicename`
in a number of places. The rest of my patch cleans up areas where this
needed fixing, to wit:
- The @-mention gloss in member header templates. @-mentions now
always use user_nicename, even with compatibility mode.
- The 'mentions' scope for `bp_has_activities()`, which now falls back
on user_nicename in all cases.
- The 'Send Public Message' button.
- Autocomplete on the Messages compose screen. Here we must use
urlencode() to remain compatible with the existing JS.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5185#comment:8>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list