Skip to:
Content
Pages
Categories
Search
Top
Bottom

Characters in usernames cause strange issues


  • zooney
    Participant

    @zooney

    I’ve found that usernames that seem to be perfectly valid for WordPress cause issues when running BuddyPress.

    For example, a username like john.smith or smith.1@domain.com will do odd things.

    If the username has a period in it (i.e. john.smith) I can’t even visit the user’s profile because it constructs urls like “http://localhost/buddypress/john-smith” and “http://localhost/buddypress/members/john-smith”. The period gets replaced by a dash, and therefore there is no user with that username and BuddyPress will redirect to the home page.

    When the “@” character is present, it’s simply omitted in urls.

    I have this running locally on:

    Windows 7

    Apache 2.2

    PHP 5.2

    MySQL 5.0

    Wordpress 2.8.6

    BuddyPress 1.1.3

    I have Buddypress running remotely on CentOS 5 with the same versions (except with PHP 5.1) and I get similar problems.

    On my remote host, I’ll get similar problems, but not as severe since, for some reason on the remote host the urls are not getting rewritten with dashes, or omitted @ symbols. Yet, I will see a few odd redirection issues, for instance, when attempting to post to the accounts own wire, after hitting post, the user is redirected to the home page rather than back to the wire…

    It’s all very odd. Although I feel I’ve determined that this problem is caused by the format of the username, since usernames without “.” or “@” in them have absolutely none of these issues when using BuddyPress.

    That said, can anyone possibly shine any light on what BuddyPress is doing with usernames like john.smith and smith.1@domain.com?

    There’s something odd going on here… any help would be appreciated.

Viewing 12 replies - 1 through 12 (of 12 total)

  • zooney
    Participant

    @zooney

    To anyone who happens upon this post in desperation…

    After posting this issue in BuddyPress’s bug tracking system, I was informed that I needed to set:

    define( ‘BP_ENABLE_USERNAME_COMPATIBILITY_MODE’, true );

    …in wp-config.php

    This seemed to resolve some of the issues, but not all of them. For some reason BuddyPress’s theme still seems to be forming the incorrect URIs in some areas.

    So, that may help in your case. I’ve actually reopened the issue to see if there’s anything further that can be done…

    see my post

    https://buddypress.org/forums/topic/all-links-are-working-minus-my-adminauthorall-of-my-pages

    that was my fix to get around the inconsistent username stuff (default everything to nicename for the urls)


    zooney
    Participant

    @zooney

    Hrrm… That’s interesting, but the thing about my issue is that I would like to default to user_login and not user_nicename (user_nicename is causing the problem).

    From your fix, I’d simply have to imagine that it should already be doing what I want, but it doesn’t. It attempts to always put in user_nicename.

    It’s very confusing. It’s also very disappointing. BuddyPress seemed to have promise for a few applications at my university, but I’m not going to be able to use it effectively without being able to use usernames that essentially look like emails (they would be Shibboleth eppns).

    I don’t get it, why is BuddyPress such a pain about usernames? If BuddyPress is a WordPress Mu plugin, it should work with any username that is valid in WordPress… I can only assume this is some kind of bug within BuddyPress itself, and I’ll continue treating it as such.

    So report it as a bug for 1.2 on https://trac.buddypress.org/. Bug reports are extremely unlikely to be picked up from this forum.


    zooney
    Participant

    @zooney

    I’ve come to a resolution in the Bug Report I filed.

    One foolish error on my part was placing the define statement in the wrong area of wp-config.php (after the “no more edits” comment).

    Regardless, I think this has clarified the bug I was actually experiencing.

    The BP_USERNAME_COMPATIBILITY_MODE flag does stop the issues associated with periods in the username from occurring, as it appears to be designed to.

    I’m running into an problem, however, where usernames with “@” in them are causing a very odd issue. For some reason if a username has an “@” in it, it will cause 2 problems I’ve found so far:

    1.) Clicking on the “Create a Group” link takes you back to the BuddyPress home page

    2.) Posting on your own wire does post the message, but for some reason redirects you to the BuddyPress home page after hitting post.

    …I have to admit I’m a little baffled as to why there needs to be a “username compatibility mode”. Wouldn’t using the “user_nicename” for everything (except just literally displaying the username) sidestep any issues with the actual form of the username? I’m just speaking from my wealth of ignorance, but that just seems weird to me.

    @zooney

    .I have to admit I’m a little baffled as to why there needs to be a “username compatibility mode”. Wouldn’t using the “user_nicename” for everything (except just literally displaying the username) sidestep any issues with the actual form of the username? I’m just speaking from my wealth of ignorance, but that just seems weird to me.

    i had the same thought and problem with @ in the user_login (hence switching everything to nicename)

    I’m 85% certain this was all the changes I made to the core files ;-)

    http://blog.etiviti.com/2010/02/forcing-buddypress-to-use-user_nicename-for-member-urls-and-mentions/


    PJ
    Participant

    @pjnu

    A BP feature or plugin that only lets you use legal symbols when creating a username would be helpful.


    r-a-y
    Keymaster

    @r-a-y

    BP inherits the registration system from WordPress, so therefore you’d need to override WP’s username functionality.


    zooney
    Participant

    @zooney

    …I just don’t see the sense in BuddyPress needing to treat usernames in a different manner than WordPress does. It smacks of a questionable design decision, that’s all.

    Regardless, I’m not getting this problem in BuddyPress 1.2 it seems…

    …although in BuddyPress 1.2 I’m getting “There was a problem posting your update, please try again.” everytime I try to do anything, but that’s a different story. =)


    Tim Nicholson
    Participant

    @timnicholson

    BP v1.21 is very whacked out in how it handles user names and profile URL’s. I’m seeing inconsistencies all over the place. Sometimes it uses the users nicename and sometimes it seems to be using their display_name. It doesn’t handle spaces in the user name at all. With some code I found on these forums, I’ve been able to patch things up a bit, but its still a mess. Check out this thread: https://buddypress.org/forums/topic/all-links-are-working-minus-my-adminauthorall-of-my-pages.

    Fixing the issue with spaces in the user name is actually quite easy by adding a urlencode() function to the string that gets used to find the user. However, in most cases the spaces in the user name are appearing because BP is using the wrong user name for the lookup.


    Paul Wong-Gibbs
    Keymaster

    @djpaul

    Closing this, please continue discussion on the linked thread above.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Characters in usernames cause strange issues’ is closed to new replies.
Skip to toolbar